Warnings compiling debug/warning-nop

Andreas Jaeger aj@suse.de
Sun Mar 27 14:35:00 GMT 2005


With GCC 4.0 I get these warnings compiling warning-nop.c:

In file included from ../include/bits/string3.h:1,
                 from ../string/string.h:422,
                 from ../include/string.h:49,
                 from warning-nop.c:40:
../string/bits/string3.h: In function ‘__memcpy_ichk’:
../string/bits/string3.h:51: warning: implicit declaration of function ‘__builtin___memcpy_chk’
../string/bits/string3.h:51: warning: implicit declaration of function ‘__builtin_object_size’
../string/bits/string3.h:51: warning: return makes pointer from integer without a cast
../string/bits/string3.h: In function ‘__memmove_ichk’:
../string/bits/string3.h:62: warning: implicit declaration of function ‘__builtin___memmove_chk’
../string/bits/string3.h:62: warning: return makes pointer from integer without a cast
[...]

These functions do not exist with GCC 4.0.  I propose the appended
patch which I've tested on i686-linux-gnu.  Ok to commit?

Andreas

2005-03-27  Andreas Jaeger  <aj@suse.de>

	* debug/warning-nop.c (__USE_FORTIFY_LEVEL): Only set with GCC 4.1
	or newer.


Index: debug/warning-nop.c
===================================================================
RCS file: /cvs/glibc/libc/debug/warning-nop.c,v
retrieving revision 1.2
diff -u -p -r1.2 warning-nop.c
--- debug/warning-nop.c	1 Mar 2005 00:42:55 -0000	1.2
+++ debug/warning-nop.c	27 Mar 2005 14:32:59 -0000
@@ -31,8 +31,10 @@ nop (void)
   extern void name (void) __attribute__ ((alias ("nop"))) attribute_hidden; \
   link_warning (name, msg)
 
-#undef	__USE_FORTIFY_LEVEL
-#define __USE_FORTIFY_LEVEL 99
+#if __GNUC_PREREQ (4,1)
+# undef	__USE_FORTIFY_LEVEL
+# define __USE_FORTIFY_LEVEL 99
+#endif
 
 /* Following here we need an #include for each public header file
    that uses __warndecl.  */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-hacker/attachments/20050327/b6e33f6f/attachment.sig>
-------------- next part --------------

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-hacker/attachments/20050327/b6e33f6f/attachment-0001.sig>


More information about the Libc-hacker mailing list