x86_64 CXX: problems passing argv around.

Post Reply

Topic author
sms
Master
Posts: 374
Joined: Fri Aug 21, 2020 5:18 pm
Reputation: 0
Status: Offline

x86_64 CXX: problems passing argv around.

Post by sms » Thu Aug 17, 2023 11:49 pm

Code: Select all

ITS $ cxx /version
VSI C++ V7.4-006 on OpenVMS IA64 V8.4-2L3

ITS $ cxx argv1.cxx /obj = argv1_ia64
ITS $ link argv1_ia64
ITS $ mcr sys$disk:[]argv1_ia64 abc
 P().  argc = 2.


V87 $ cxx /version
clang version 10.0.1 (git@bitbucket.org:vms_software/llvm-10.0.1.git d469fd71c59
f33c7d998debe420a69abb31f1f57)
Build date: 06-16-2023
Target: x86_64-OpenVMS
Thread model: posix
InstalledDir: V87$DKA400:[SYS0.SYSCOMMON.][SYSEXE]

V87 $ cxx argv1.cxx /obj = argv1_x86
ITS$DKA0:[UTILITY.SOURCE.UNRAR.dev]argv1.cxx;2:10:3: error: no matching function
 for call to 'Parse'
  Parse( argc, argv);
  ^~~~~
ITS$DKA0:[UTILITY.SOURCE.UNRAR.dev]argv1.cxx;2:3:6: note: candidate function not
 viable: no known conversion from 'char * __ptr32 *' to 'char **' for 2nd argume
nt
void Parse( int argc, char *argv[])
     ^
1 error generated.


   Safe bet that this involves 32-bit v. 64-bit pointers?


ITS $ type argv1.cxx
#include <stdio.h>

void Parse( int argc, char *argv[])
{
  printf( " P().  argc = %d.\n", argc);
}

int main(int argc, char *argv[])
{
  Parse( argc, argv);

  return 0;
}


   Any simple work-around?

   Note that changing "*argv[]" to "**argv" makes the error message
longer with no other obvious benefit.

   My apologies if this is a known phenomenon, and I slept through the
discussion because it involved C++.

   Note that PRODUCT SHOW PRODUCT says that my CXX is:
      VSI X86VMS CXX A10.0-230616

   I see a VSI-X86VMS-CXX-A1000-230718-1 kit on the Service Platform,
but, as a peon, I lack access.


jonesd
Valued Contributor
Posts: 78
Joined: Mon Aug 09, 2021 7:59 pm
Reputation: 0
Status: Offline

Re: x86_64 CXX: problems passing argv around.

Post by jonesd » Fri Aug 18, 2023 12:01 am

Try compiling with /pointer_size=long=argv.


Topic author
sms
Master
Posts: 374
Joined: Fri Aug 21, 2020 5:18 pm
Reputation: 0
Status: Offline

Re: x86_64 CXX: problems passing argv around.

Post by sms » Fri Aug 18, 2023 2:07 am

Code: Select all

> Try compiling with /pointer_size=long=argv.

   Ah, yes.  Thanks for the reminder.  I did use that for some 64-bit
zlib variant in 2018, but probably neither before nor since.  And, no
doubt, the error messages were different with that compiler.

   That advances me to a flood of "dangling-else" complaints, and a few
other things, but those might be manageable.


marty.stu
Site Admin
Valued Contributor
Posts: 96
Joined: Tue May 21, 2019 6:56 am
Reputation: 0
Status: Offline

Re: x86_64 CXX: problems passing argv around.

Post by marty.stu » Fri Aug 18, 2023 5:45 am

sms wrote:
Thu Aug 17, 2023 11:49 pm

I see a VSI-X86VMS-CXX-A1000-230718-1 kit on the Service Platform,
but, as a peon, I lack access.
Steven,

You do have access to this package as a community user. Screenshot taken from an account impersonating a community user:

Image
Run to the bedroom, In the suitcase on the left You'll find my favorite axe.


Topic author
sms
Master
Posts: 374
Joined: Fri Aug 21, 2020 5:18 pm
Reputation: 0
Status: Offline

Re: x86_64 CXX: problems passing argv around.

Post by sms » Fri Aug 18, 2023 9:02 am

Code: Select all

> You do have access to this package as a community user. [...]

   Hmmm.  Seems to work now.  Perhaps I selected the wrong community
when I tried it.  Thanks for checking.

Post Reply