develooper Front page | perl.perl5.porters | Postings from February 2003

Re: [PATCH Storable 2.06] const declaration fixup

Thread Previous | Thread Next
Craig A. Berry
February 3, 2003 20:51
Re: [PATCH Storable 2.06] const declaration fixup
Message ID:
At 2:24 PM -0800 2/2/03, Yitzchak Scott-Thoennes wrote:
>On Sun, 26 Jan 2003 10:51:55 +0000, wrote:
>>Craig A. Berry <> writes:
>>>With recent versions of Compaq C under OpenVMS, the latest Storable
>>>version fails to compile like so:
>>>Include=(perl_root:[lib.VMS_AXP.5_6_1.CORE])/Optimize  STORABLE.c
>>>     WRITE(header, length);
>>>%CC-W-NOTCONSTQUAL, In this statement, the referenced type of the
>>>pointer value "header" is const, but the referenced type of the target
>>>of this assignment is not.
>>>at line number 3369 in file D0:[CRAIG.STORABLE-2_06]STORABLE.XS;1
>>What would it take to make WRITE(const char *,...) ?
>WRITE is a macro.  header ends up as the second parameter of either
>memcpy or PerlIO_write (where it may become the first parameter of
>fwrite or second parameter of sfwrite).  All the above *should* be
>const *.  Are they?

Thanks, Nick and Yitzchak, for the replies, and sorry for the slow
response from my end.  I think it is an error in our home-grown
fwrite.  Here is the prototype from 5.6.1's vms/vmsish.h:

int     my_fwrite (void *, size_t, size_t, FILE *);

and here it is from 5.8.0:

int    my_fwrite (const void *, size_t, size_t, FILE *);

which is still not quite right because the return value should be
size_t per C99, but at least the first arg is now const.  Sigh.  I
can confirm, though, that Storable 2.06 builds fine and passes all
tests with Perl 5.8.0 on VMS.

So this really doesn't look like Storable's problem at all.  I suppose
the patch is as good a workaround as any for someone using
5.6.1, but unless 5.6.1 bugs are being tracked and fixed separately
it looks like #15878 is just clutter.  Apologies for not digging
deeper sooner.

Craig A. Berry

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About