This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Warnings compiling debug/warning-nop


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.  */

Attachment: pgp00000.pgp
Description: PGP signature

-- 
 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

Attachment: pgp00001.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]