Thread: [Autogen-users] 5.16.1 make check failure
Brought to you by:
bkorb
From: Harlan S. <st...@nt...> - 2012-06-18 07:01:32
|
On pogo, after fixing the zNotStr instance: ... PASS: loop.test PATH is /usr/local/gnu/bin:/usa/stenn/bin:/usr/local/bin:/usr/local/gnu/bin:/opt/SUNWrtvc/bin:/opt/SUNWspro/bin:/opt/netbeans-5.5.1/bin:/usr/X11R6/bin:/usr/bin/X11:/usr/openwin/bin:/bin:/usr/bin:/usr/ccs/bin:/usr/ucb:/usr/local/etc:/etc:/usr/local/sbin:/sbin:/usr/sbin:. creating make.tpl creating make.out in /pogo/dist/gnu/autogen/autogen-5.16.1/A.pogo/agen5/test/testdir FAILURE: 7,13d6 < < == converts to: < < foo=`pwd` && ls -l $$foo ; \ < bar=$$foo continue=command \ < make macros: $(MAKE) $* $@ $< $% $? ; \ < shell vars: $${MAKE} $$# $$F $${?} $${*} $$$$ FAIL: make.test ... -- Harlan Stenn <st...@nt...> http://networktimefoundation.org - be a member! |
From: Bruce K. <bru...@gm...> - 2012-06-18 17:38:26
|
On 06/17/12 23:26, Harlan Stenn wrote: > On pogo, after fixing the zNotStr instance: > > ... > PASS: loop.test > PATH is > /usr/local/gnu/bin:/usa/stenn/bin:/usr/local/bin:/usr/local/gnu/bin:/opt/SUNWrtvc/bin:/opt/SUNWspro/bin:/opt/netbeans-5.5.1/bin:/usr/X11R6/bin:/usr/bin/X11:/usr/openwin/bin:/bin:/usr/bin:/usr/ccs/bin:/usr/ucb:/usr/local/etc:/etc:/usr/local/sbin:/sbin:/usr/sbin:. > creating make.tpl > creating make.out in > /pogo/dist/gnu/autogen/autogen-5.16.1/A.pogo/agen5/test/testdir > FAILURE: 7,13d6 > < > < == converts to: > < > < foo=`pwd`&& ls -l $$foo ; \ > < bar=$$foo continue=command \ > < make macros: $(MAKE) $* $@ $< $% $? ; \ > < shell vars: $${MAKE} $$# $$F $${?} $${*} $$$$ > FAIL: make.test > ... > on PSP-OS1: > ------------------------------------------------------------------------ > Configuration: > > Source code location: /home/bkorb/autogen-5.16.1pre7 > Compiler: gcc -std=gnu99 > Compiler flags: -g -O2 > Host System Type: i386-pc-solaris2.11 > Install path: /home/bkorb/build/os1 > > See config.h for further configuration information. > ------------------------------------------------------------------------ > $ make > ~/build/os1/build.log 2> ~/build/os1/errors.log > $ make check >> ~/build/os1/build.log 2>> ~/build/os1/errors.log > gmake install >> ~/build/os1/build.log 2>> ~/build/os1/errors.log > $ gmake install >> ~/build/os1/build.log 2>> ~/build/os1/errors.log > $ find ~/build/os1/ > bin/ build.log errors.log include/ lib/ share/ > /var/tmp/bkorb-AFaOY0/ag > $ find ~/build/os1/bin -type f > /home/bkorb/build/os1/bin/xml2ag > /home/bkorb/build/os1/bin/autogen > /home/bkorb/build/os1/bin/autoopts-config > /home/bkorb/build/os1/bin/columns > $ fgrep ' tests ' ~/build/os1/build.log > All 24 tests passed > All 41 tests passed > All 4 tests passed > $ gcc --version > gcc-4.5 (GCC) 4.5.2 On POGO.UDEL.EDU: > ------------------------------------------------------------------------ > Configuration: > > Source code location: .. > Compiler: gcc -std=gnu99 > Compiler flags: -g -O2 > Host System Type: sparc-sun-solaris2.10 > Install path: /usa/bkorb/autogen-5.16.1/_i > > See config.h for further configuration information. > ------------------------------------------------------------------------ > ~/autogen-5.16.1/_b > $ ( exec > build.log 2> err.log >> set -e >> gmake >> gmake check >> gmake install >> ) & That does not build: > $ cat err.log > ../../autoopts/usage.c: In function 'prt_extd_usage': > ../../autoopts/usage.c:469: warning: passing argument 1 of 'spn_ag_char_map_chars' discards qualifiers from pointer target type But that message is completely bogus: > #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) > { > unsigned char const * v = ag_char_map_spanners[mask_ix]; > if (v == NULL) > v = calc_ag_char_map_spanners(mask_ix); > while (v[(unsigned)*p]) p++; > return p; > } > > char const * pzArgType; > pzArgType = SPN_WHITESPACE_CHARS(pzArgType); the SPN_WHITESPACE_CHARS macro casts the pointer to "char *", stripping the qualifier. > $ gcc --version > gcc (GCC) 4.2.0 |
From: Dave H. <dav...@gm...> - 2012-06-18 17:57:28
|
On Mon, Jun 18, 2012 at 5:38 PM, Bruce Korb <bru...@gm...> wrote: > On 06/17/12 23:26, Harlan Stenn wrote: >> On pogo, after fixing the zNotStr instance: >> >> ... >> PASS: loop.test >> PATH is >> /usr/local/gnu/bin:/usa/stenn/bin:/usr/local/bin:/usr/local/gnu/bin:/opt/SUNWrtvc/bin:/opt/SUNWspro/bin:/opt/netbeans-5.5.1/bin:/usr/X11R6/bin:/usr/bin/X11:/usr/openwin/bin:/bin:/usr/bin:/usr/ccs/bin:/usr/ucb:/usr/local/etc:/etc:/usr/local/sbin:/sbin:/usr/sbin:. >> creating make.tpl >> creating make.out in >> /pogo/dist/gnu/autogen/autogen-5.16.1/A.pogo/agen5/test/testdir >> FAILURE: 7,13d6 >> < >> < == converts to: >> < >> < foo=`pwd`&& ls -l $$foo ; \ >> < bar=$$foo continue=command \ >> < make macros: $(MAKE) $* $@ $< $% $? ; \ >> < shell vars: $${MAKE} $$# $$F $${?} $${*} $$$$ >> FAIL: make.test >> ... >> > > on PSP-OS1: > >> ------------------------------------------------------------------------ >> Configuration: >> >> Source code location: /home/bkorb/autogen-5.16.1pre7 >> Compiler: gcc -std=gnu99 >> Compiler flags: -g -O2 >> Host System Type: i386-pc-solaris2.11 >> Install path: /home/bkorb/build/os1 >> >> See config.h for further configuration information. >> ------------------------------------------------------------------------ >> $ make > ~/build/os1/build.log 2> ~/build/os1/errors.log >> $ make check >> ~/build/os1/build.log 2>> ~/build/os1/errors.log >> gmake install >> ~/build/os1/build.log 2>> ~/build/os1/errors.log >> $ gmake install >> ~/build/os1/build.log 2>> ~/build/os1/errors.log >> $ find ~/build/os1/ >> bin/ build.log errors.log include/ lib/ share/ >> /var/tmp/bkorb-AFaOY0/ag >> $ find ~/build/os1/bin -type f >> /home/bkorb/build/os1/bin/xml2ag >> /home/bkorb/build/os1/bin/autogen >> /home/bkorb/build/os1/bin/autoopts-config >> /home/bkorb/build/os1/bin/columns >> $ fgrep ' tests ' ~/build/os1/build.log >> All 24 tests passed >> All 41 tests passed >> All 4 tests passed >> $ gcc --version >> gcc-4.5 (GCC) 4.5.2 > > On POGO.UDEL.EDU: > >> ------------------------------------------------------------------------ >> Configuration: >> >> Source code location: .. >> Compiler: gcc -std=gnu99 >> Compiler flags: -g -O2 >> Host System Type: sparc-sun-solaris2.10 >> Install path: /usa/bkorb/autogen-5.16.1/_i >> >> See config.h for further configuration information. >> ------------------------------------------------------------------------ >> ~/autogen-5.16.1/_b >> $ ( exec > build.log 2> err.log >>> set -e >>> gmake >>> gmake check >>> gmake install >>> ) & > > That does not build: > >> $ cat err.log >> ../../autoopts/usage.c: In function 'prt_extd_usage': >> ../../autoopts/usage.c:469: warning: passing argument 1 of 'spn_ag_char_map_chars' discards qualifiers from pointer target type Why would that warning break the build? I didn't see -Werr being used. > 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) >> { >> unsigned char const * v = ag_char_map_spanners[mask_ix]; >> if (v == NULL) >> v = calc_ag_char_map_spanners(mask_ix); >> while (v[(unsigned)*p]) p++; >> return p; >> } >> >> 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. > > $ gcc --version > > gcc (GCC) 4.2.0 Cheers, Dave Hart |
From: Bruce K. <bru...@gm...> - 2012-06-18 19:04:27
|
On 06/18/12 10:57, Dave Hart wrote: So curiosity got the better of me. Here is code from glibc: > /* Find the first occurrence of C in S. */ > char * > strchr (s, c_in) > const char *s; > int c_in; > { > const unsigned char *char_ptr; > const unsigned long int *longword_ptr; > unsigned long int longword, magic_bits, charmask; > unsigned reg_char c; > > c = (unsigned char) c_in; > > /* Handle the first few characters by reading one character at a time. > Do this until CHAR_PTR is aligned on a longword boundary. */ > for (char_ptr = (const unsigned char *) s; > ((unsigned long int) char_ptr & (sizeof (longword) - 1)) != 0; > ++char_ptr) > if (*char_ptr == c) > return (void *) char_ptr; Please notice the last line. The cast is being used to strip the const-ness from "char_ptr". This is not really different from stripping it from the argument. |
From: Bruce K. <bru...@gm...> - 2012-06-18 18:22:50
|
On 06/18/12 10:57, Dave Hart wrote: > On Mon, Jun 18, 2012 at 5:38 PM, Bruce Korb<bru...@gm...> 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 |
From: Bruce K. <bru...@gm...> - 2012-06-18 20:56:10
|
On 06/18/12 11:22, Bruce Korb wrote: > > I have not seen Harlan's message about zNotStr, > so I don't know what the issue is. I've found the problem: It exists in an atrophied section of code for Guile 1.6 only code. I've fixed it in my source now. Since I don't have access to any platform with 6 year old Guile, I have to depend on others to alert me during the "pre" release phase. Guile 1.8 was released in 2006 and 1.7 before that. To be clear: Guile 1.4 is now utterly de-supported. I'd like to be rid of 1.6, too. |
From: Dave H. <dav...@da...> - 2012-06-18 18:39:59
|
On Mon, Jun 18, 2012 at 6:22 PM, Bruce Korb <bru...@gm...> wrote: > On 06/18/12 10:57, Dave Hart wrote: >> >> On Mon, Jun 18, 2012 at 5:38 PM, Bruce Korb<bru...@gm...> 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. A void * cast would suffer the same warning. If spn_ag_char_map_chars() accepts both const char * and char * arguments, the correct argument prototype is const char *. It is safe to cast char * to const char *, but the reverse is not true--you are breaking the contract with the compiler to not allow writes through pointers to const declared as such. My understanding is const char * and char const * are equivalent, so spell it how you prefer. It is quite feasible to honor const throughout AutoGen/AutoOpts, if you so choose, but that means giving on up on the theory const is for you to control your users but does not control you. At worst, you'll need to play dirty with const at the boundary to third party code that gets it wrong. I wish I understood why newer gcc isn't warning in the same situation -- but I believe it's wrong, as any stripping of const potentially violates the const contract (potentially because the consumers of de-consted pointers may not in fact write). Cheers, Dave Hart |
From: Bruce K. <bru...@gm...> - 2012-06-18 18:52:01
|
Hi Dave, You missed the point. I do not want two functions: char const * fnc(char const * in) as well as char * fnnc(char * in) any more than libc wants two flavors of strstr(), for example. So strstr() returns char * and it is up to the caller to be careful. Perhaps the right thing is to pound the const-ness out of the pointer inside the function instead of the wrapper, but that is not the way I grew up all those years ago. Instead, I'll cast it thus, beit in the function or macro: (char *)(uintptr_t)const_str_ptr On Mon, Jun 18, 2012 at 11:39 AM, Dave Hart <dav...@da...> wrote: > A void * cast would suffer the same warning. If > spn_ag_char_map_chars() accepts both const char * and char * > arguments, the correct argument prototype is const char *. It is safe > to cast char * to const char *, but the reverse is not true The returned result must be assignment compatible with the provided argument. If the provided argument is not const, then the result is not const. > I wish I understood why newer gcc isn't warning in the same situation > -- but I believe it's wrong, as any stripping of const potentially > violates the const contract (potentially because the consumers of > de-consted pointers may not in fact write). Then a convenient solution for the strstr class of functions needs to be considered. (Where the attribute of the result matches whatever was provided.) |
From: Harlan S. <st...@nt...> - 2012-06-18 22:31:21
|
Bruce wrote: > I've found the problem: It exists in an atrophied section of code > for Guile 1.6 only code. I've fixed it in my source now. > Since I don't have access to any platform with 6 year old Guile, > I have to depend on others to alert me during the "pre" release phase. > Guile 1.8 was released in 2006 and 1.7 before that. > > To be clear: Guile 1.4 is now utterly de-supported. > I'd like to be rid of 1.6, too. I'm happy to try this - my hesitation is that my experience with updating some of these packages under Solaris is a must miserable experience. But if you want I'l give it a shot. H |