<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]? in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762479#M41306</link>
    <description>&lt;!--!*#--&gt;&amp;gt; If I've translated your magic string "Ã Ã Ã z"&lt;BR /&gt;&amp;gt; correctly, [...]&lt;BR /&gt;&lt;BR /&gt;That's not really the pointer itself, but the&lt;BR /&gt;"string" it pointed to, although it's not far&lt;BR /&gt;off.  My fprintf() diagnostic output looked&lt;BR /&gt;like this:&lt;BR /&gt;&lt;BR /&gt;[...]&lt;BR /&gt; cms.  argc = 10.&lt;BR /&gt;[Here, it's looking at the non-option&lt;BR /&gt;(file-name) arguments.  "argc_x" was my&lt;BR /&gt;temporary count (-down-to-one) of valid&lt;BR /&gt;remaining arguments.]&lt;BR /&gt; cms(1).  argc_x = 3, *args: &amp;gt;smime-certs/smrsa1.pem&amp;lt;.&lt;BR /&gt; file_ctrl().  ptr: %x00000000004e077a &amp;gt;smime-certs/smrsa1.pem&amp;lt;.&lt;BR /&gt; cms(1).  argc_x = 2, *args: &amp;gt;smime-certs/smrsa2.pem&amp;lt;.&lt;BR /&gt; file_ctrl().  ptr: %x00000000004e0791 &amp;gt;smime-certs/smrsa2.pem&amp;lt;.&lt;BR /&gt; cms(1).  argc_x = 1, *args: &amp;gt;smime-certs/smrsa3.pem&amp;lt;.&lt;BR /&gt; file_ctrl().  ptr: %x00000000004e07a8 &amp;gt;smime-certs/smrsa3.pem&amp;lt;.&lt;BR /&gt; cms(1).  argc_x = 0, *args: &amp;gt;Ã Ã Ã z&amp;lt;.&lt;BR /&gt; file_ctrl().  ptr: %x000000007adcd870 &amp;gt;Ã Ã Ã z&amp;lt;.&lt;BR /&gt;Error opening recipient certificate file Ã Ã Ã z&lt;BR /&gt;[...]&lt;BR /&gt;&lt;BR /&gt;("file_ctrl()" is the function which actually&lt;BR /&gt;tried to open the file by name.)&lt;BR /&gt;&lt;BR /&gt;So, unless I bungled something, that last&lt;BR /&gt;"ptr:" value (which looks significantly&lt;BR /&gt;different from the earlier, valid ones) is&lt;BR /&gt;what everyone was hoping would be all zeros.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] Does argv always map to the same&lt;BR /&gt;&amp;gt; location? (I don't have a C compiler to&lt;BR /&gt;&amp;gt; experiment with).&lt;BR /&gt;&lt;BR /&gt;I believe that it was pretty reliable, but&lt;BR /&gt;once I found out what was happening, I&lt;BR /&gt;stopped paying close attention to the&lt;BR /&gt;details.  I figured that someone must know&lt;BR /&gt;who builds argv[], and how, so if this was an&lt;BR /&gt;actual bug, then it should be pretty easy to&lt;BR /&gt;investigate and/or fix.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] (I don't have a C compiler to&lt;BR /&gt;&amp;gt; experiment with).&lt;BR /&gt;&lt;BR /&gt;That's a pretty shameful admission, isn't it.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt; The standard at [...]&lt;BR /&gt;&lt;BR /&gt;Hmmm.  Those certainly are suggestive.&lt;BR /&gt;Perhaps it was always thus, and I, blinded by&lt;BR /&gt;the existence of argc, never noticed.  Or,&lt;BR /&gt;perhaps whoever's setting this stuff up&lt;BR /&gt;thinks that it's being done properly, but&lt;BR /&gt;apparently it's not.  Certainly, most of the&lt;BR /&gt;code I've seen looks at argc, not for a NULL&lt;BR /&gt;at the and of argv[], and most VMS users&lt;BR /&gt;don't compile most stuff with a 64-bit&lt;BR /&gt;argv[], so a problem like this might easily&lt;BR /&gt;have been missed.</description>
    <pubDate>Tue, 08 Mar 2011 04:15:28 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2011-03-08T04:15:28Z</dc:date>
    <item>
      <title>CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762475#M41302</link>
      <description>&lt;!--!*#--&gt;Here's an interesting quirk into which I&lt;BR /&gt;recently ran.  I was trying to build a recent&lt;BR /&gt;OpenSSL kit (1.0.0d) using 64-bit pointers.&lt;BR /&gt;(CC /POINTER_SIZE=64=ARGV [...].)&lt;BR /&gt;&lt;BR /&gt;After getting past most of the easy problems,&lt;BR /&gt;I ran into some test failures whose cause was&lt;BR /&gt;unexpected, perhaps even novel.  Several of&lt;BR /&gt;the [.apps]*.c programs scan their&lt;BR /&gt;command-line argv[] array using code like&lt;BR /&gt;this:&lt;BR /&gt;&lt;BR /&gt;[...]&lt;BR /&gt;int MAIN(int argc, char **argv)&lt;BR /&gt;[...]&lt;BR /&gt;        char **args;&lt;BR /&gt;[...]&lt;BR /&gt;        args = argv + 1;&lt;BR /&gt;[...]&lt;BR /&gt;                while (*args)   [or similar]&lt;BR /&gt;[...]&lt;BR /&gt;                        args++;&lt;BR /&gt;[...]&lt;BR /&gt;&lt;BR /&gt;That is, they look for a NULL terminator at&lt;BR /&gt;(past) the end of "argv".  (I might have&lt;BR /&gt;expected to see this sort of thing with&lt;BR /&gt;envp[], but I'd've figured that argc was there&lt;BR /&gt;for a reason, and I'd've used that for&lt;BR /&gt;determining where argv[] ended.  But it's not&lt;BR /&gt;my code.)&lt;BR /&gt;&lt;BR /&gt;This NULL-terminator expectation seems to work&lt;BR /&gt;well enough on VAX and IA64, and on Alpha with&lt;BR /&gt;32-bit pointers, but, on Alpha with 64-bit&lt;BR /&gt;pointers, it breaks down.  In that case, these&lt;BR /&gt;programs frequently see one extra garbage&lt;BR /&gt;argument on their command lines, leading to&lt;BR /&gt;symptoms like:&lt;BR /&gt;&lt;BR /&gt;Error opening recipient certificate file ÀØÜz&lt;BR /&gt;&lt;BR /&gt;where "ÀØÜz" is what appears to follow the&lt;BR /&gt;usual (real) command-line arguments in argv[].&lt;BR /&gt;&lt;BR /&gt;The obvious fix is to re-write these programs&lt;BR /&gt;so that they use argc, and don't look for a&lt;BR /&gt;NULL terminator at the end of argv[].  But,&lt;BR /&gt;it's apparent that some people seem to expect&lt;BR /&gt;this thing to be NULL-terminated, and in this&lt;BR /&gt;situation, it's not.  For all I know, there's&lt;BR /&gt;some POSIX standard (or something) which&lt;BR /&gt;demands that argv[] be NULL-terminated, in&lt;BR /&gt;which case, this would seem to be a bug.  In&lt;BR /&gt;any case, there would seem to be a plausible&lt;BR /&gt;argument to be made for making this work as&lt;BR /&gt;well on Alpha as it seems to on IA64 (whether&lt;BR /&gt;that's from good design or just good luck).&lt;BR /&gt;(And if it is only good luck, then it might be&lt;BR /&gt;good to add a little reinforcement to the&lt;BR /&gt;luck.)&lt;BR /&gt;&lt;BR /&gt;alp $ cc /version&lt;BR /&gt;HP C V7.3-009 on OpenVMS Alpha V8.3&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;With no patch access these days, this is all&lt;BR /&gt;of only academic interest to me, but I thought&lt;BR /&gt;that it might be of some interest to a broader&lt;BR /&gt;audience.</description>
      <pubDate>Mon, 07 Mar 2011 23:48:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762475#M41302</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-03-07T23:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762476#M41303</link>
      <description>Steven,&lt;BR /&gt;&lt;BR /&gt;  Interesting. I'm curious to know if this is one of those things that fell out of someone's implementation, that are now widespread enough to warrant standardising.&lt;BR /&gt;&lt;BR /&gt;  Since your pointers are now 64 bit, is it possible there's a 32 bit null, followed by junk?&lt;BR /&gt;&lt;BR /&gt;If I've translated your magic string "Ã Ã Ã z" correctly, it's hex 7ADCD8C0, which on my V8.3 system appears to be inside DCL. Does argv always map to the same location? (I don't have a C compiler to experiment with).</description>
      <pubDate>Tue, 08 Mar 2011 03:14:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762476#M41303</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2011-03-08T03:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762477#M41304</link>
      <description>The standard at&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://c0x.coding-guidelines.com/5.1.2.2.1.html#170" target="_blank"&gt;http://c0x.coding-guidelines.com/5.1.2.2.1.html#170&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;or 5.1.2.2.1 of C99 if you're following along elsewhere, says&lt;BR /&gt;&lt;BR /&gt;"â   argv[argc] shall be a null pointer."&lt;BR /&gt;&lt;BR /&gt;So I think you've found a bug.</description>
      <pubDate>Tue, 08 Mar 2011 03:28:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762477#M41304</guid>
      <dc:creator>Craig A Berry</dc:creator>
      <dc:date>2011-03-08T03:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762478#M41305</link>
      <description>Also, the POSIX specs on exec and friends&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://pubs.opengroup.org/onlinepubs/009695399/functions/execve.html" target="_blank"&gt;http://pubs.opengroup.org/onlinepubs/009695399/functions/execve.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;say, "The argument argv is an array of character pointers to null-terminated strings. The application shall ensure that the last member of this array is a null pointer. "</description>
      <pubDate>Tue, 08 Mar 2011 03:35:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762478#M41305</guid>
      <dc:creator>Craig A Berry</dc:creator>
      <dc:date>2011-03-08T03:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762479#M41306</link>
      <description>&lt;!--!*#--&gt;&amp;gt; If I've translated your magic string "Ã Ã Ã z"&lt;BR /&gt;&amp;gt; correctly, [...]&lt;BR /&gt;&lt;BR /&gt;That's not really the pointer itself, but the&lt;BR /&gt;"string" it pointed to, although it's not far&lt;BR /&gt;off.  My fprintf() diagnostic output looked&lt;BR /&gt;like this:&lt;BR /&gt;&lt;BR /&gt;[...]&lt;BR /&gt; cms.  argc = 10.&lt;BR /&gt;[Here, it's looking at the non-option&lt;BR /&gt;(file-name) arguments.  "argc_x" was my&lt;BR /&gt;temporary count (-down-to-one) of valid&lt;BR /&gt;remaining arguments.]&lt;BR /&gt; cms(1).  argc_x = 3, *args: &amp;gt;smime-certs/smrsa1.pem&amp;lt;.&lt;BR /&gt; file_ctrl().  ptr: %x00000000004e077a &amp;gt;smime-certs/smrsa1.pem&amp;lt;.&lt;BR /&gt; cms(1).  argc_x = 2, *args: &amp;gt;smime-certs/smrsa2.pem&amp;lt;.&lt;BR /&gt; file_ctrl().  ptr: %x00000000004e0791 &amp;gt;smime-certs/smrsa2.pem&amp;lt;.&lt;BR /&gt; cms(1).  argc_x = 1, *args: &amp;gt;smime-certs/smrsa3.pem&amp;lt;.&lt;BR /&gt; file_ctrl().  ptr: %x00000000004e07a8 &amp;gt;smime-certs/smrsa3.pem&amp;lt;.&lt;BR /&gt; cms(1).  argc_x = 0, *args: &amp;gt;Ã Ã Ã z&amp;lt;.&lt;BR /&gt; file_ctrl().  ptr: %x000000007adcd870 &amp;gt;Ã Ã Ã z&amp;lt;.&lt;BR /&gt;Error opening recipient certificate file Ã Ã Ã z&lt;BR /&gt;[...]&lt;BR /&gt;&lt;BR /&gt;("file_ctrl()" is the function which actually&lt;BR /&gt;tried to open the file by name.)&lt;BR /&gt;&lt;BR /&gt;So, unless I bungled something, that last&lt;BR /&gt;"ptr:" value (which looks significantly&lt;BR /&gt;different from the earlier, valid ones) is&lt;BR /&gt;what everyone was hoping would be all zeros.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] Does argv always map to the same&lt;BR /&gt;&amp;gt; location? (I don't have a C compiler to&lt;BR /&gt;&amp;gt; experiment with).&lt;BR /&gt;&lt;BR /&gt;I believe that it was pretty reliable, but&lt;BR /&gt;once I found out what was happening, I&lt;BR /&gt;stopped paying close attention to the&lt;BR /&gt;details.  I figured that someone must know&lt;BR /&gt;who builds argv[], and how, so if this was an&lt;BR /&gt;actual bug, then it should be pretty easy to&lt;BR /&gt;investigate and/or fix.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] (I don't have a C compiler to&lt;BR /&gt;&amp;gt; experiment with).&lt;BR /&gt;&lt;BR /&gt;That's a pretty shameful admission, isn't it.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt; The standard at [...]&lt;BR /&gt;&lt;BR /&gt;Hmmm.  Those certainly are suggestive.&lt;BR /&gt;Perhaps it was always thus, and I, blinded by&lt;BR /&gt;the existence of argc, never noticed.  Or,&lt;BR /&gt;perhaps whoever's setting this stuff up&lt;BR /&gt;thinks that it's being done properly, but&lt;BR /&gt;apparently it's not.  Certainly, most of the&lt;BR /&gt;code I've seen looks at argc, not for a NULL&lt;BR /&gt;at the and of argv[], and most VMS users&lt;BR /&gt;don't compile most stuff with a 64-bit&lt;BR /&gt;argv[], so a problem like this might easily&lt;BR /&gt;have been missed.</description>
      <pubDate>Tue, 08 Mar 2011 04:15:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762479#M41306</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-03-08T04:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762480#M41307</link>
      <description>&lt;!--!*#--&gt;Here's a simple reproducer.  Works ok on Itanium, but fails on Alpha (though not a particularly up-to-date on ECOs Alpha).  Hard to say that it's a compiler or CRTL problem for sure since something might have already gone wrong before language support took over from the image activator.&lt;BR /&gt;&lt;BR /&gt;$ create argv_of_argc.c&lt;BR /&gt;#include &lt;UNIXLIB.H&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;&lt;BR /&gt;int main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;    void *p = argv[argc];&lt;BR /&gt;&lt;BR /&gt;    if (p != NULL)&lt;BR /&gt;        printf("not ");&lt;BR /&gt;&lt;BR /&gt;    printf("OK - argv[argc] should be NULL (got %p)\n", p);&lt;BR /&gt;}&lt;BR /&gt;^Z&lt;BR /&gt;$ cc/pointer_size=32 argv_of_argc&lt;BR /&gt;$ link argv_of_argc&lt;BR /&gt;$ r argv_of_argc&lt;BR /&gt;OK - argv[argc] should be NULL (got 0)&lt;BR /&gt;$ cc/pointer_size=64=argv argv_of_argc&lt;BR /&gt;$ link argv_of_argc&lt;BR /&gt;$ r argv_of_argc&lt;BR /&gt;not OK - argv[argc] should be NULL (got 7FF57810)&lt;BR /&gt;$ cc/vers&lt;BR /&gt;HP C V7.3-009 on OpenVMS Alpha V8.3&lt;BR /&gt;&lt;/STDIO.H&gt;&lt;/UNIXLIB.H&gt;</description>
      <pubDate>Tue, 08 Mar 2011 21:22:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762480#M41307</guid>
      <dc:creator>Craig A Berry</dc:creator>
      <dc:date>2011-03-08T21:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762481#M41308</link>
      <description>&amp;gt;That's a pretty shameful admission, &lt;BR /&gt;&amp;gt;isn't it.&lt;BR /&gt;&lt;BR /&gt;  au contraire!&lt;BR /&gt;&lt;BR /&gt;  Having spent almost 20 years as a tech support "linguist", dealing with all manner problems reported in the full spectrum of programming languages, C was, by far, the worst for programmers reporting "I've found a bug" when the real issue was they didn't understand what they'd really asked the compiler to do (next in line was Basic, but that's another story)&lt;BR /&gt;&lt;BR /&gt;  Far too heavy on obscure syntax "swiss army knife" control structures, and far too light on easily understood data structure definitions.&lt;BR /&gt;&lt;BR /&gt;  Indeed, this report is a perfect example of the fundamental problem with the language. Proponents of C would laud the "freedom" to code something as basic as processing an argument list in different ways.&lt;BR /&gt;&lt;BR /&gt;  I'd expect a programmer to be able to glance at and immediately recognise argument parsing without having to figure out which variation the programmer has chosen. &lt;BR /&gt;&lt;BR /&gt;  The dependence that a programmer is supposed to "just know" that an argument list is terminated by a null, along with the volumes of other critically important language-lawyer trivia is a recipe for building in bugs.&lt;BR /&gt;&lt;BR /&gt;  All programming languages have ideosyncratic faults, but C takes the art form to a whole new level. The only reason the language survives at all is the strategic history of giving compilers away free to universities in the late 1970's, and the resulting momentum from programmers who never knew any better. (At the same time a BLISS compiler license was US$20K per year)</description>
      <pubDate>Tue, 08 Mar 2011 21:33:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762481#M41308</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2011-03-08T21:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762482#M41309</link>
      <description>Hi Steve,&lt;BR /&gt;&lt;BR /&gt;I am not trying to reduce the severity of the problem. But a more POSIX ey way of doing it these days I guess is to use the getopt family of functions than messing with the command line options in the application anyway :). Can you just see if that works ?&lt;BR /&gt;&lt;BR /&gt;--Lucifer &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Mar 2011 11:26:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762482#M41309</guid>
      <dc:creator>Lucifer Megacruel</dc:creator>
      <dc:date>2011-03-09T11:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762483#M41310</link>
      <description>&lt;!--!*#--&gt;&amp;gt; [...] Can you just see if that works ?&lt;BR /&gt;&lt;BR /&gt;Perhaps I could, but I won't.  It's not my&lt;BR /&gt;code, and I really doubt that the OpenSSL&lt;BR /&gt;folks would like to drag all the getopt stuff&lt;BR /&gt;into their product, even if it would help&lt;BR /&gt;work around this (VMS-specific) problem.  (I&lt;BR /&gt;know that _I_ wouldn't.)&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] a more POSIX ey way [...]&lt;BR /&gt;&lt;BR /&gt;The _most_ POSIX-y way of doing anything is&lt;BR /&gt;usually to make the C infrastructure&lt;BR /&gt;(compiler, RTL, ...) follow the POSIX&lt;BR /&gt;standard, which seems not to be happening&lt;BR /&gt;here.&lt;BR /&gt;&lt;BR /&gt;My initial work-around was to re-write the&lt;BR /&gt;command-line processing code to look at argc,&lt;BR /&gt;but, as the head OpenSSL guy suggested, it's&lt;BR /&gt;a smaller change to check&lt;BR /&gt;      if (argv[ argc] != NULL)&lt;BR /&gt;in a central location (which exists), and&lt;BR /&gt;then, if necessary, make a properly&lt;BR /&gt;terminated duplicate argv[], and then pass&lt;BR /&gt;that along to the consumers, instead of the&lt;BR /&gt;original, defective argv[].  It's ugly, but&lt;BR /&gt;it works (and it's more compact than "fixing"&lt;BR /&gt;the several consumers).&lt;BR /&gt;&lt;BR /&gt;I sent a short message to&lt;BR /&gt;OpenVMS.Programs@you-know-where, citing this&lt;BR /&gt;thread, so I'm sure that the appropriate&lt;BR /&gt;engineers will soon be all over this problem.&lt;BR /&gt;Perhaps someday I'll even be able to get hold&lt;BR /&gt;of the patch which fixes it, but I'm not&lt;BR /&gt;holding my breath.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt; au contraire!&lt;BR /&gt;&amp;gt; [...]&lt;BR /&gt;&lt;BR /&gt;With great power comes great responsibility.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] a programmer is supposed to "just&lt;BR /&gt;&amp;gt; know" [...]&lt;BR /&gt;&lt;BR /&gt;Or just read one of those standards&lt;BR /&gt;documents.  Of course, it helps if the&lt;BR /&gt;underlying implementation is bug-free.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] The only reason the language survives&lt;BR /&gt;&amp;gt; at all [...]&lt;BR /&gt;&lt;BR /&gt;There's a reason that people try to gain&lt;BR /&gt;market share for a new product.  Momentum,&lt;BR /&gt;once gained, can require significant force&lt;BR /&gt;and/or time to extinguish.  (Ask Newton.)</description>
      <pubDate>Wed, 09 Mar 2011 12:02:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762483#M41310</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-03-09T12:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762484#M41311</link>
      <description>Hi Steve,&lt;BR /&gt;&lt;QUOTE author="Steve"&gt;&lt;BR /&gt;The _most_ POSIX-y way of doing anything is&lt;BR /&gt;usually to make the C infrastructure&lt;BR /&gt;(compiler, RTL, ...) follow the POSIX&lt;BR /&gt;standard, which seems not to be happening&lt;BR /&gt;here.&lt;BR /&gt;&lt;/QUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;I am not denying that, let me take a look at it deeper, may be when i have some more time.&lt;BR /&gt;&lt;BR /&gt;--Lucifer&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Mar 2011 12:52:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762484#M41311</guid>
      <dc:creator>Lucifer Megacruel</dc:creator>
      <dc:date>2011-03-09T12:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762485#M41312</link>
      <description>The problem was on IA64 at one time:&lt;BR /&gt;&lt;BR /&gt;IA64 Dec C compiler for OpenVMS: Includes fix for problem related to specifying /POINTER_SIZE=LONG=ARGV, the argv argument to main, which comprised of long pointers, was not terminated with NULL. &lt;BR /&gt;&lt;BR /&gt;This problem has been corrected   HP-I64VMS-C-V0703-019ECO1-1 &lt;BR /&gt; &lt;BR /&gt;I would seem the problem was the same root issue.  I didn't see a matching Alpha patch.&lt;BR /&gt;&lt;BR /&gt;-Jeff</description>
      <pubDate>Wed, 09 Mar 2011 13:35:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762485#M41312</guid>
      <dc:creator>Jeffrey Goodwin</dc:creator>
      <dc:date>2011-03-09T13:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762486#M41313</link>
      <description>&lt;!--!*#--&gt;"&lt;BR /&gt;For all I know, there's&lt;BR /&gt;some POSIX standard (or something) which&lt;BR /&gt;demands that argv[] be NULL-terminated [...]&lt;BR /&gt;"&lt;BR /&gt;&lt;BR /&gt;It is in the C standard. From ISO/IEC 9899:201x&lt;BR /&gt;&lt;BR /&gt;5.1.2.2.1 Program startup&lt;BR /&gt;&lt;BR /&gt;1 The function called at program startup is named main. The implementation declares no&lt;BR /&gt;prototype for this function. It shall be defined with a return type of int and with no&lt;BR /&gt;parameters:&lt;BR /&gt;&lt;BR /&gt;  int main(void) { /* ... */ }&lt;BR /&gt;&lt;BR /&gt;or with two parameters (referred to here as argc and argv, though any names may be&lt;BR /&gt;used, as they are local to the function in which they are declared):&lt;BR /&gt;&lt;BR /&gt;  int main(int argc, char *argv[]) { /* ... */ }&lt;BR /&gt;&lt;BR /&gt;or equivalent;9) or in some other implementation-defined manner.&lt;BR /&gt;&lt;BR /&gt;2 If they are declared, the parameters to the main function shall obey the following&lt;BR /&gt;constraints:&lt;BR /&gt;&lt;BR /&gt;â   The value of argc shall be nonnegative.&lt;BR /&gt;&lt;BR /&gt;â   argv[argc] shall be a null pointer.&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Mar 2011 15:08:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762486#M41313</guid>
      <dc:creator>WW304289</dc:creator>
      <dc:date>2011-03-09T15:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762487#M41314</link>
      <description>&amp;gt;on Alpha with 64-bit pointers, it breaks down.  In that case, these programs frequently see one extra garbage argument on their command lines&lt;BR /&gt;&lt;BR /&gt;Have you tried printing that address?  Perhaps only 32 bits is zero?</description>
      <pubDate>Sat, 12 Mar 2011 04:01:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762487#M41314</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-03-12T04:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762488#M41315</link>
      <description>&lt;!--!*#--&gt;&amp;gt; Have you tried printing that address?&lt;BR /&gt;&lt;BR /&gt;Have you tried reading this thread?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;  Perhaps only 32 bits is zero?&lt;BR /&gt;&lt;BR /&gt;We're little-endian here, so values like:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] ptr: %x000000007adcd870 [...]&lt;BR /&gt;(Mar 8, 2011 04:15:28 GMT)&lt;BR /&gt;&lt;BR /&gt;or:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] (got 7FF57810)&lt;BR /&gt;(Mar 8, 2011 21:22:47 GMT)&lt;BR /&gt;&lt;BR /&gt;aren't even zero at the beginning (the&lt;BR /&gt;low-significance end).&lt;BR /&gt;&lt;BR /&gt;But thanks for playing.</description>
      <pubDate>Sat, 12 Mar 2011 04:20:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762488#M41315</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-03-12T04:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762489#M41316</link>
      <description>This problem has been corrected HP-I64VMS-C-V0703-019ECO1-1&lt;BR /&gt;&lt;BR /&gt;I would seem the problem was the same root issue. I didn't see a matching Alpha patch.&lt;BR /&gt;&lt;BR /&gt;---&lt;BR /&gt;&lt;BR /&gt;I've seen some internal-to-HP communication on this one, and apparently VMS Engineering states that an Alpha patch is in the works.&lt;BR /&gt;I have no idea when it's due to hit the streets.&lt;BR /&gt;&lt;BR /&gt;     -- Rob</description>
      <pubDate>Sat, 12 Mar 2011 04:54:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762489#M41316</guid>
      <dc:creator>Robert Brooks_1</dc:creator>
      <dc:date>2011-03-12T04:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762490#M41317</link>
      <description>&lt;!--!*#--&gt;&amp;gt; This problem has been corrected&lt;BR /&gt;&amp;gt; HP-I64VMS-C-V0703-019ECO1-1&lt;BR /&gt;&lt;BR /&gt;Hey.  Sure enough.  That's so old that even&lt;BR /&gt;_I_ have it:&lt;BR /&gt;&lt;BR /&gt;IT $ cc /version&lt;BR /&gt;HP C V7.3-019 on OpenVMS IA64 V8.3-1H1&lt;BR /&gt;&lt;BR /&gt;which explains why I saw the problem only on&lt;BR /&gt;Alpha (V7.3-009).&lt;BR /&gt;&lt;BR /&gt;I probably read the ".txt" file when I&lt;BR /&gt;downloaded the patch, but figured that I'd&lt;BR /&gt;never care, and promptly forgot all about it.&lt;BR /&gt;(It's not my fault.  This 64-bit pointer&lt;BR /&gt;stuff was all someone else's idea.  I may&lt;BR /&gt;still never care for my own purposes.)&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] an Alpha patch is in the works.&lt;BR /&gt;&amp;gt; I have no idea when it's due to hit the&lt;BR /&gt;&amp;gt; streets.&lt;BR /&gt;&lt;BR /&gt;That's nice to know, but, of course, a lowly&lt;BR /&gt;hobbyist peon like me may never see it, as I&lt;BR /&gt;can no longer gain access to those streets.</description>
      <pubDate>Sat, 12 Mar 2011 05:19:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762490#M41317</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-03-12T05:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE=64=ARGV, Alpha, NULL termination of argv[]?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762491#M41318</link>
      <description>&amp;gt;Have you tried reading this thread?&lt;BR /&gt;&lt;BR /&gt;Oops, sorry I missed that.&lt;BR /&gt;It would have helped if you printed them as increasing:&lt;BR /&gt;"argv[%d] = ptr: %p, %s\n", i, &amp;amp;argv[i], argv[i]&lt;BR /&gt;&lt;BR /&gt;&amp;gt;aren't even zero at the beginning (the low-significance end).&lt;BR /&gt;&lt;BR /&gt;Yes.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 12 Mar 2011 13:59:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-64-argv-alpha-null-termination-of-argv/m-p/4762491#M41318</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-03-12T13:59:21Z</dc:date>
    </item>
  </channel>
</rss>

