On 06/18/12 10:57, Dave Hart wrote: > On Mon, Jun 18, 2012 at 5:38 PM, Bruce Korb<bruce.k...@gmail.com> wrote: >> On 06/17/12 23:26, Harlan Stenn wrote: >>> On pogo, after fixing the zNotStr instance:
I have not seen Harlan's message about zNotStr, so I don't know what the issue is. >> That does not build: >> But that message is completely bogus: > > It doesn't seem bogus to me. See below. > >>> #define SPN_WHITESPACE_CHARS(_s) spn_ag_char_map_chars((char *)_s, 11) >>> static inline char * >>> spn_ag_char_map_chars(char * p, unsigned int mask_ix) >>> char const * pzArgType; >>> pzArgType = SPN_WHITESPACE_CHARS(pzArgType); >> >> the SPN_WHITESPACE_CHARS macro casts the pointer to "char *", stripping the >> qualifier. > > Right, stripping the "const" qualifier triggers the warning. No idea > why you didn't see it with gcc 4.5.2, but again what really broke the > build? As Harlan mentioned he had to update a zNotStr reference to > the new identifier. When I build it for myself, I use -Wall -Werror and I do not see a failure, or even a warning. Since spn_ag_char_map_chars does not care if the input is char const * or not, but the caller cares whether the result can be assigned to a char* pointer, I use the cast in the macro wrapper. I've been using this paradigm for decades and never seen a burp before. Why would gcc 4.5.2 be happy on psp-os1 and gcc 4.2 whack my knuckles on pogo? I suppose I can use a "void *" cast, but all I really want to do is strip the const-ness, not the underlying type. A cudgel should not be required. On psp-os1: gcc -std=gnu99 -DHAVE_CONFIG_H -I. \ -I/home/bkorb/autogen-5.16.1pre7/agen5 -I.. \ -I.. -I/home/bkorb/autogen-5.16.1pre7 \ -I../autoopts -I/home/bkorb/autogen-5.16.1pre7/autoopts \ -I/usr/local/include -D_REENTRANT -pthreads -g -O2 \ -MT autogen-ag.o -MD -MP -MF .deps/autogen-ag.Tpo \ -c -o autogen-ag.o ag.c I wonder what the re-entrant pthreads are about. Anyway, versus pogo: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../../agen5 -I.. \ -I.. -I../.. -I../autoopts -I../../autoopts \ -I/usr/local/gnu/include -g -O2 -MT autogen-ag.o \ -MD -MP -MF .deps/autogen-ag.Tpo -c -o autogen-ag.o ag.c ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Autogen-users mailing list Autogen-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/autogen-users