Rainer Orth <r...@cebitec.uni-bielefeld.de> writes: > The recent warning patches broke the libssp build on Solaris: > > /vol/gcc/src/hg/master/local/libssp/gets-chk.c: In function '__gets_chk': > /vol/gcc/src/hg/master/local/libssp/gets-chk.c:67:12: error: implicit > declaration of function 'gets'; did you mean 'getw'? > [-Wimplicit-function-declaration] > 67 | return gets (s); > | ^~~~ > | getw > /vol/gcc/src/hg/master/local/libssp/gets-chk.c:67:12: error: returning > 'int' from a function with return type 'char *' makes pointer from integer > without a cast [-Wint-conversion] > 67 | return gets (s); > | ^~~~~~~~ > /vol/gcc/src/hg/master/local/libssp/gets-chk.c:74:12: error: returning > 'int' from a function with return type 'char *' makes pointer from integer > without a cast [-Wint-conversion] > 74 | return gets (s); > | ^~~~~~~~ > > The guard around the gets declaration in gets-chk.c is > > #if !(!defined __USE_ISOC11 \ > || (defined __cplusplus && __cplusplus <= 201103L)) > extern char *gets (char *); > #endif > > __USE_ISOC11 is a glibc-only thing, while Solaris <iso/stdio_iso.h> > declares gets like > > #if __STDC_VERSION__ < 201112L && __cplusplus < 201402L > extern char *gets(char *) __ATTR_DEPRECATED; > #endif > > If one needs to check __USE_ISO11 at all, one certainly needs to check > __STDC_VERSION__ to avoid breaking every non-glibc target. Besides, I > don't see what's the use of checking __cplusplus when compiling a C-only > source file. On top of all that, the double negation makes the guard > unnecessarily hard to understand. > > I really don't know if it's useful/appropriate to check __USE_ISOC11 and > __cplusplus here at all; still I've left both for now. > > Here's what I've used to complete the Solaris bootstrap. > > Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, > x86_64-pc-linux-gnu, and x86_64-apple-darwin23.1.0.
Ping? It's only been four days, but without a fix Solaris bootstrap remains broken. In hindsight, I wonder if it wouldn't be better to just check for a gets declaration using AC_CHECK_DECLS, rather than second-guessing what guards various implementions use, even messing with implementation-private macros... Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University