mirror of
https://github.com/gcc-mirror/gcc.git
synced 2024-11-21 13:40:47 +00:00
3cec491196
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 || (defined __cplusplus && __cplusplus <= 201103L)) extern char *gets (char *); where __USE_ISOC11 is glibc-only, while Solaris <iso/stdio_iso.h> declares gets like extern char *gets(char *) __ATTR_DEPRECATED; Instead of using a target-specific macro, this patch just uses the canonical autoconf test. Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, x86_64-pc-linux-gnu, x86_64-apple-darwin23.3.0, and amd64-freebsd14.0. 2023-12-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> libssp: * configure.ac (AC_CHECK_DECLS): Check for gets. * configure, config.h.in: Regenerate. * gets-chk.c (gets): Guard declaration with !HAVE_DECL_GETS. |
||
---|---|---|
.. | ||
ssp | ||
aclocal.m4 | ||
ChangeLog | ||
config.h.in | ||
configure | ||
configure.ac | ||
gets-chk.c | ||
libtool-version | ||
Makefile.am | ||
Makefile.in | ||
memcpy-chk.c | ||
memmove-chk.c | ||
mempcpy-chk.c | ||
memset-chk.c | ||
snprintf-chk.c | ||
sprintf-chk.c | ||
ssp-local.c | ||
ssp.c | ||
ssp.map | ||
stpcpy-chk.c | ||
strcat-chk.c | ||
strcpy-chk.c | ||
strncat-chk.c | ||
strncpy-chk.c | ||
vsnprintf-chk.c | ||
vsprintf-chk.c |