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

Re: [PATCH Storable 2.06] const declaration fixup

Thread Previous | Thread Next
From:
Craig A. Berry
Date:
February 3, 2003 20:51
Subject:
Re: [PATCH Storable 2.06] const declaration fixup
Message ID:
a05200f0eba64ef7a51f4@[172.16.52.1]
At 2:24 PM -0800 2/2/03, Yitzchak Scott-Thoennes wrote:
>On Sun, 26 Jan 2003 10:51:55 +0000, nick@ing-simmons.net wrote:
>>Craig A. Berry <craigberry@mac.com> writes:
>>>With recent versions of Compaq C under OpenVMS, the latest Storable
>>>version fails to compile like so:
>>>
>>>CC/DECC
>>>/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=.obj/NoList/NOANSI_ALIAS/Define=("VERSION=""2.06""","XS_VERSION=""2.06""")/
>>>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
mailto:craigberry@mac.com

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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About