gcc/libssp
Rainer Orth 3cec491196 libssp: Fix gets-chk.c compilation on Solaris
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.
2024-02-06 11:45:45 +01:00
..
ssp Update copyright years. 2024-01-03 12:19:35 +01:00
aclocal.m4
ChangeLog
config.h.in libssp: Fix gets-chk.c compilation on Solaris 2024-02-06 11:45:45 +01:00
configure libssp: Fix gets-chk.c compilation on Solaris 2024-02-06 11:45:45 +01:00
configure.ac libssp: Fix gets-chk.c compilation on Solaris 2024-02-06 11:45:45 +01:00
gets-chk.c libssp: Fix gets-chk.c compilation on Solaris 2024-02-06 11:45:45 +01:00
libtool-version
Makefile.am Update copyright years. 2024-01-03 12:19:35 +01:00
Makefile.in
memcpy-chk.c Update copyright years. 2024-01-03 12:19:35 +01:00
memmove-chk.c Update copyright years. 2024-01-03 12:19:35 +01:00
mempcpy-chk.c Update copyright years. 2024-01-03 12:19:35 +01:00
memset-chk.c Update copyright years. 2024-01-03 12:19:35 +01:00
snprintf-chk.c Update copyright years. 2024-01-03 12:19:35 +01:00
sprintf-chk.c Update copyright years. 2024-01-03 12:19:35 +01:00
ssp-local.c Update copyright years. 2024-01-03 12:19:35 +01:00
ssp.c Update copyright years. 2024-01-03 12:19:35 +01:00
ssp.map
stpcpy-chk.c Update copyright years. 2024-01-03 12:19:35 +01:00
strcat-chk.c Update copyright years. 2024-01-03 12:19:35 +01:00
strcpy-chk.c Update copyright years. 2024-01-03 12:19:35 +01:00
strncat-chk.c Update copyright years. 2024-01-03 12:19:35 +01:00
strncpy-chk.c Update copyright years. 2024-01-03 12:19:35 +01:00
vsnprintf-chk.c Update copyright years. 2024-01-03 12:19:35 +01:00
vsprintf-chk.c Update copyright years. 2024-01-03 12:19:35 +01:00