<?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 = 32 v. &amp;lt;stdlib.h&amp;gt; -- %CC-I-FUNCMIXPTR in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768611#M41354</link>
    <description>$ help cc/pointer_size says&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;     Specifying /POINTER_SIZE=32 directs the compiler to assume that all&lt;BR /&gt;     pointers are 32-bit pointers.  But unlike the default of&lt;BR /&gt;     /NOPOINTER_SIZE, /POINTER_SIZE=32 enables use of the #pragma&lt;BR /&gt;     pointer_size long and #pragma pointer_size short preprocessor&lt;BR /&gt;     directives to control pointer size throughout your program.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and those pragmas are in use in stdlib.h.  It looks as though giving a value to the /POINTER_SIZE qualifier enables the __INITIAL_POINTER_SIZE macro, but untangling the rest of what's going on in that header is more than I have time for at the moment.  I'd be sure to compile with /list/show=(expansion,include) to see what prototypes and pragmas you're actually getting.</description>
    <pubDate>Tue, 22 Mar 2011 21:33:50 GMT</pubDate>
    <dc:creator>Craig A Berry</dc:creator>
    <dc:date>2011-03-22T21:33:50Z</dc:date>
    <item>
      <title>CC /POINTER_SIZE = 32 v. &lt;stdlib.h&gt; -- %CC-I-FUNCMIXPTR</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768608#M41351</link>
      <description>&lt;!--!*#--&gt;I don't mean to nit-pick (not much, anyway),&lt;BR /&gt;but why am I (acting as an informal proxy for&lt;BR /&gt;the OpenSSL organization) getting these&lt;BR /&gt;annoying informational messages from what&lt;BR /&gt;should be identical situations?  (Shouldn't&lt;BR /&gt;they be?)&lt;BR /&gt;&lt;BR /&gt;alp $ type funcmixptr.c&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;&lt;BR /&gt;static void *(*realloc_func)(void *, size_t) = realloc;&lt;BR /&gt;&lt;BR /&gt;static void (*free_func)(void *) = free;&lt;BR /&gt;&lt;BR /&gt;int main( int argc, char **argv) {}&lt;BR /&gt;&lt;BR /&gt;Case 1.  No complaints:&lt;BR /&gt;alp $ cc /noobject /nopointer_size funcmixptr.c&lt;BR /&gt;&lt;BR /&gt;Case 2.  Annoying complaints:&lt;BR /&gt;alp $ cc /noobject /pointer_size = 32 funcmixptr.c&lt;BR /&gt;&lt;BR /&gt;static void *(*realloc_func)(void *, size_t) = realloc;&lt;BR /&gt;..................................^&lt;BR /&gt;%CC-I-FUNCMIXPTR, In the initializer for realloc_func, function types differ bec&lt;BR /&gt;ause this declaration specifies "short pointer" and a previous declaration speci&lt;BR /&gt;fies "long pointer".&lt;BR /&gt;at line number 3 in file ALP$DKA0:[SMS.IZ]funcmixptr.c;4&lt;BR /&gt;&lt;BR /&gt;static void (*free_func)(void *) = free;&lt;BR /&gt;..............................^&lt;BR /&gt;%CC-I-FUNCMIXPTR, In the initializer for free_func, function types differ becaus&lt;BR /&gt;e this declaration specifies "short pointer" and a previous declaration specifie&lt;BR /&gt;s "long pointer".&lt;BR /&gt;at line number 5 in file ALP$DKA0:[SMS.IZ]funcmixptr.c;4&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The pointers are all supposed to be 32-bit in&lt;BR /&gt;both cases, aren't they?  (Who writes these&lt;BR /&gt;header files?)&lt;BR /&gt;&lt;BR /&gt;Who can explain why this is all my fault,&lt;BR /&gt;and/or why this is how it's supposed to work?&lt;/STDLIB.H&gt;</description>
      <pubDate>Tue, 22 Mar 2011 19:41:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768608#M41351</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-03-22T19:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE = 32 v. &lt;stdlib.h&gt; -- %CC-I-FUNCMIXPTR</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768609#M41352</link>
      <description>&lt;!--!*#--&gt;Oh, yeah...&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;IT $ cc /version&lt;BR /&gt;HP C V7.3-019 on OpenVMS IA64 V8.3-1H1</description>
      <pubDate>Tue, 22 Mar 2011 19:56:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768609#M41352</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-03-22T19:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE = 32 v. &lt;stdlib.h&gt; -- %CC-I-FUNCMIXPTR</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768610#M41353</link>
      <description>The following comment is based on looking at stdlib.h from this configuration:&lt;BR /&gt;&lt;BR /&gt;HP C V7.1-015 on OpenVMS Alpha V8.3    &lt;BR /&gt;&lt;BR /&gt;This line:&lt;BR /&gt;&lt;BR /&gt;void * realloc (__void_ptr64 __ptr, __size_t __size);&lt;BR /&gt;&lt;BR /&gt;looks like it might be a bug, based on the other calls around it. &lt;BR /&gt;&lt;BR /&gt;Switching the line over to this:&lt;BR /&gt;&lt;BR /&gt;void * realloc (void *_ptr, __size_t __size);&lt;BR /&gt;&lt;BR /&gt;fixes the first diagnostic.  Here's the line and the replacement line in context:&lt;BR /&gt;&lt;BR /&gt;    void * calloc  (__size_t __nmemb, __size_t __size);&lt;BR /&gt;    void * malloc  (__size_t __size);&lt;BR /&gt; //   void * realloc (__void_ptr64 __ptr, __size_t __size);&lt;BR /&gt;    void * realloc (void *_ptr, __size_t __size);&lt;BR /&gt;    void * bsearch (const void *, const void *, __size_t, __size_t, int (*__comp&lt;BR /&gt;ar)(const void *, const void *));&lt;BR /&gt;    void   qsort   (void *, __size_t, __size_t, int (*__compar)(const void *, co&lt;BR /&gt;nst void *));&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This line:&lt;BR /&gt;&lt;BR /&gt;void     free     (void *__nptr);&lt;BR /&gt;&lt;BR /&gt;is always declared as a 64-bit function, irrespective of the requested pointer length; just as soon as you include /pointer_size on the command, this becomes a 64-bit pointer.  This based on the preceding &lt;BR /&gt;&lt;BR /&gt;#   pragma __pointer_size 64&lt;BR /&gt;&lt;BR /&gt;And that also too seems it might be a bug, too.&lt;BR /&gt;&lt;BR /&gt;The C language gurus will probably need to have a look at this one.</description>
      <pubDate>Tue, 22 Mar 2011 20:54:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768610#M41353</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2011-03-22T20:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE = 32 v. &lt;stdlib.h&gt; -- %CC-I-FUNCMIXPTR</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768611#M41354</link>
      <description>$ help cc/pointer_size says&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;     Specifying /POINTER_SIZE=32 directs the compiler to assume that all&lt;BR /&gt;     pointers are 32-bit pointers.  But unlike the default of&lt;BR /&gt;     /NOPOINTER_SIZE, /POINTER_SIZE=32 enables use of the #pragma&lt;BR /&gt;     pointer_size long and #pragma pointer_size short preprocessor&lt;BR /&gt;     directives to control pointer size throughout your program.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and those pragmas are in use in stdlib.h.  It looks as though giving a value to the /POINTER_SIZE qualifier enables the __INITIAL_POINTER_SIZE macro, but untangling the rest of what's going on in that header is more than I have time for at the moment.  I'd be sure to compile with /list/show=(expansion,include) to see what prototypes and pragmas you're actually getting.</description>
      <pubDate>Tue, 22 Mar 2011 21:33:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768611#M41354</guid>
      <dc:creator>Craig A Berry</dc:creator>
      <dc:date>2011-03-22T21:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE = 32 v. &lt;stdlib.h&gt; -- %CC-I-FUNCMIXPTR</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768612#M41355</link>
      <description>&lt;!--!*#--&gt;&amp;gt; The following comment [...]&lt;BR /&gt;&lt;BR /&gt;Yup.  That's how it looks around here, too.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; The C language gurus will probably need to&lt;BR /&gt;&amp;gt; have a look at this one.&lt;BR /&gt;&lt;BR /&gt;I've sent a pointer off to&lt;BR /&gt;OpenVMS.Programs@hp, just in case it might&lt;BR /&gt;help.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt; $ help cc/pointer_size says&lt;BR /&gt;&lt;BR /&gt;I read it.  Hence my complaint.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] to see what prototypes and pragmas&lt;BR /&gt;&amp;gt; you're actually getting.&lt;BR /&gt;&lt;BR /&gt;Not very interesting, actually.  I'm getting&lt;BR /&gt;only what's in the system header files&lt;BR /&gt;(modules), so whatever happens is not my&lt;BR /&gt;fault (I claim).  The complaints are only&lt;BR /&gt;"-I-", so the build procedure is unaffected,&lt;BR /&gt;and the stuff works, so they don't seem to&lt;BR /&gt;matter much, but I (for one) would be happier&lt;BR /&gt;if the system headers didn't give the&lt;BR /&gt;compiler indigestion on otherwise&lt;BR /&gt;harmless-looking code, depending on the&lt;BR /&gt;harmless-looking compiler options.</description>
      <pubDate>Tue, 22 Mar 2011 22:01:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768612#M41355</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-03-22T22:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE = 32 v. &lt;stdlib.h&gt; -- %CC-I-FUNCMIXPTR</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768613#M41356</link>
      <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;I would point you Section 1.10 of the the OpenVMS CRTL manual where there is a good discussion of mixing and 32bit and 64 bit pointers in the same application . free is a function that accepts both 32bit and 64 bit pointers . In order to allocate 32 bit memory in 64 bit application you need to call _malloc32. So if you if you do &lt;BR /&gt;&lt;BR /&gt;void *(*realloc_func)(void *, size_t) = _realloc32;&lt;BR /&gt;&lt;BR /&gt;it will silence the compiler when compiled with /POINTER=32. There is nothing you can do to silence free , since it is designed to accept both 32 bit and 64 bit pointers. As a good programmer, I understand that it is annoying to find warnings when it is not your fault. &lt;BR /&gt; &lt;BR /&gt;One caveat you need to be careful though:&lt;BR /&gt;The the 32 bit and 64 bit malloc calls corresponding lib$ routines in librtl. There is no communication between these 32 bit and 64 bit librtl routines. 32 bit routines allocate memory from  P0  and 64 bit from P2 space. So if you allocate memory in 32bit space and use realloc64 to copy it will fail.&lt;BR /&gt;But in the program given below, if you remove the first line , you will find that librtl allocates the requested size. But this is because no malloc64 is not yet called, so it thinks it is a fresh allocation.&lt;BR /&gt;&lt;BR /&gt;complile with /POINTER=LONG&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;        &lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;char *test = malloc(1); /* remove this line to see the issue */&lt;BR /&gt;__char_ptr32 c1 = (__char_ptr32)_malloc32(1);&lt;BR /&gt;*c1 = 'x';&lt;BR /&gt;printf("%08llx : &amp;lt;%c&amp;gt;\n", c1, *c1);&lt;BR /&gt;char* c2 = (char*)realloc(c1, 10000); /* force reallocation */&lt;BR /&gt;             &lt;BR /&gt;if( c2 == NULL)&lt;BR /&gt;             {&lt;BR /&gt;               printf(" Realloc  fails !" );&lt;BR /&gt;             }&lt;BR /&gt;             return EXIT_FAILURE;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;--Lucifer&lt;BR /&gt;&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Wed, 23 Mar 2011 05:31:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768613#M41356</guid>
      <dc:creator>Lucifer Megacruel</dc:creator>
      <dc:date>2011-03-23T05:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE = 32 v. &lt;stdlib.h&gt; -- %CC-I-FUNCMIXPTR</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768614#M41357</link>
      <description>&lt;!--!*#--&gt;
&lt;P&gt;&amp;gt; I would point you Section 1.10 of the the&lt;BR /&gt;&amp;gt; OpenVMS CRTL manual&lt;BR /&gt;&lt;BR /&gt;I've been there, thanks.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; where there is a good&lt;BR /&gt;&amp;gt; discussion of mixing and 32bit and 64 bit&lt;BR /&gt;&amp;gt; pointers in the same application . [...]&lt;BR /&gt;&lt;BR /&gt;Which, as you can see, _I_ wasn't doing.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] So if you if you do [...]&lt;BR /&gt;&lt;BR /&gt;My complaint wasn't that it was impossible to&lt;BR /&gt;avoid the compiler complaints. My complaint&lt;BR /&gt;was that explicitly specifying the default&lt;BR /&gt;pointer size gives results which differ from&lt;BR /&gt;those one gets from implicitly accepting the&lt;BR /&gt;default pointer size. This seems to me to be&lt;BR /&gt;undesirable.&lt;BR /&gt;&lt;BR /&gt;I've already had to add enough functional&lt;BR /&gt;work-arounds to this code to get past the&lt;BR /&gt;argv[] problems:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h30499.www3.hp.com/t5/Languages-and-Scripting/CC-POINTER-SIZE-64-ARGV-Alpha-NULL-termination-of-argv/m-p/4762475#M8190" target="_blank"&gt;http://h30499.www3.hp.com/t5/Languages-and-Scripting/CC-POINTER-SIZE-64-ARGV-Alpha-NULL-termination-of-argv/m-p/4762475#M8190&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I hate to (try to) add more additional&lt;BR /&gt;VMS-specific clutter to a widely portable&lt;BR /&gt;open-source project than is absolutely&lt;BR /&gt;necessary.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2011 17:19:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768614#M41357</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-08-04T17:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE = 32 v. &lt;stdlib.h&gt; -- %CC-I-FUNCMIXPTR</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768615#M41358</link>
      <description>On thinking about it and irrespective of whether the call accepts 32- or 64-bit, having free always be declared with 64-bit pointers is broken.  It's valid in terms of the implicit promotion, but fails in terms of the compiler diagnostics.&lt;BR /&gt;&lt;BR /&gt;The other standard library calls in that same wad as the free call are equally likely to toss a spurious diagnostic, if (for whatever reason) you want or need to pass those around as pointers, too.&lt;BR /&gt;&lt;BR /&gt;Your options are exceedingly limited, at least for now.  Probably the best available of a bad lot is suppressing the compiler diagnostic via #pragma, possibly introduced via the usual /FIRST_INCLUDE mechanism. &lt;BR /&gt;&lt;BR /&gt;This for either for production builds, or for all builds.&lt;BR /&gt;&lt;BR /&gt;Less desirably, replace the free with your own jacket with a correct declaration, or with a cast in the assignment.&lt;BR /&gt;&lt;BR /&gt;Even less desirably, pull the header file and diff/patch it.  Fix it.&lt;BR /&gt;&lt;BR /&gt;The first include diagnostic suppression approach will will reduce the visibility of changes to the OpenSSL folks; they'll end up with a VMS-specific compile command and a VMS-specific (first include) header file, which probably won't concern them quite as much as scattering VMS changes in the bulk of the OpenSSL codebase.&lt;BR /&gt;&lt;BR /&gt;Comment the details of the #pragma for the suppression, obviously.&lt;BR /&gt;</description>
      <pubDate>Wed, 23 Mar 2011 11:34:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768615#M41358</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2011-03-23T11:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE = 32 v. &lt;stdlib.h&gt; -- %CC-I-FUNCMIXPTR</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768616#M41359</link>
      <description>Hello,&lt;BR /&gt;Below is the suggestion for the customer:&lt;BR /&gt;-----------------------------------------------------------&lt;BR /&gt;$ type my_header.h&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;&lt;BR /&gt;#if __INITIAL_POINTER_SIZE == 32&lt;BR /&gt; void *(*realloc_func)(void *, size_t) = _realloc32;&lt;BR /&gt;#elif __INITIAL_POINTER_SIZE == 64&lt;BR /&gt; void *(*realloc_func)(void *, size_t) = _realloc64;&lt;BR /&gt;#else&lt;BR /&gt; void *(*realloc_func)(void *, size_t) = realloc;&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;#if __INITIAL_POINTER_SIZE == 32 || !defined __INITIAL_POINTER_SIZE&lt;BR /&gt;#       pragma __pointer_size __save&lt;BR /&gt;#       pragma __pointer_size 64&lt;BR /&gt;#endif&lt;BR /&gt;        void (*free_func)(void *) = free;&lt;BR /&gt;&lt;BR /&gt;#if __INITIAL_POINTER_SIZE == 32 || !defined __INITIAL_POINTER_SIZE&lt;BR /&gt;#       pragma __pointer_size __restore&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;$&lt;BR /&gt;$ type FUNCMIXPTR_MY_HEADER.C;&lt;BR /&gt;#include "my_header.h"&lt;BR /&gt;int main( int argc, char **argv) {}&lt;BR /&gt;&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;$ cc /noobject /pointer_size=64 FUNCMIXPTR_MY_HEADER&lt;BR /&gt;$ cc /noobject /pointer_size=32 FUNCMIXPTR_MY_HEADER&lt;BR /&gt;$ cc /noobject /nopointer_size FUNCMIXPTR_MY_HEADER&lt;BR /&gt;$&lt;BR /&gt;-----------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;BR /&gt;OpenVMS CRTL Engineering&lt;/STDLIB.H&gt;</description>
      <pubDate>Mon, 28 Mar 2011 04:35:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768616#M41359</guid>
      <dc:creator>JagadishM</dc:creator>
      <dc:date>2011-03-28T04:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: CC /POINTER_SIZE = 32 v. &lt;stdlib.h&gt; -- %CC-I-FUNCMIXPTR</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768617#M41360</link>
      <description>&lt;!--!*#--&gt;As others have pointed out, the realloc() and free() functions are declared in &lt;STDLIB.H&gt; as expecting a 64-bit pointer. This technique is used throughout the C Run-Time Library headers for all functions accepting a 64-bit pointer.&lt;BR /&gt;&lt;BR /&gt;Such function prototypes allow passing a 64-bit pointer even in a program compiled with /pointer_size=32. It is done to support mixed pointer size mode, which is something that, to the best of my knowledge, no other platform supports, except, may be, Tru64 UNIX, but I don't remember all the details.&lt;BR /&gt;&lt;BR /&gt;The best workaround is, probably, using "convenient" types from &lt;DECC&gt;. This header is included by all other C RTL headers.&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;static void *(*realloc_func)(__void_ptr64, size_t) = realloc;&lt;BR /&gt;static void (*free_func)(__void_ptr64) = free;&lt;BR /&gt;&lt;BR /&gt;As for portability, one needs to define what portability means in this case as the original program compiles cleanly in strict ANSI mode. It is when the program is compiled with VMS-specific /pointer_size switch, the compiler starts emitting diagnostics.&lt;BR /&gt;&lt;BR /&gt;-Boris&lt;/STDLIB.H&gt;&lt;/DECC&gt;&lt;/STDLIB.H&gt;</description>
      <pubDate>Mon, 28 Mar 2011 14:56:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cc-pointer-size-32-v-lt-stdlib-h-gt-cc-i-funcmixptr/m-p/4768617#M41360</guid>
      <dc:creator>WW304289</dc:creator>
      <dc:date>2011-03-28T14:56:33Z</dc:date>
    </item>
  </channel>
</rss>

