diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2024-02-06 11:45:45 +0100 |
---|---|---|
committer | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2024-02-06 11:45:45 +0100 |
commit | 3cec49119681d43fd613285a5cad43313d27eb3d (patch) | |
tree | 78661705334f88567686f7606ee27ff8e08cf767 /gcc/tree-vect-loop.cc | |
parent | ca04e7a2e1b08ed02e22e2656ba6032099195856 (diff) | |
download | gcc-3cec49119681d43fd613285a5cad43313d27eb3d.zip gcc-3cec49119681d43fd613285a5cad43313d27eb3d.tar.gz gcc-3cec49119681d43fd613285a5cad43313d27eb3d.tar.bz2 |
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.
Diffstat (limited to 'gcc/tree-vect-loop.cc')
0 files changed, 0 insertions, 0 deletions