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]

Re: Warnings compiling debug/warning-nop


Roland McGrath <roland@frob.com> writes:

>> What about adding proper prototypes for these functions for older GCC
>> versions?
>
> You can just #define them away since the only part of the headers that
> matters for warning-nop.c is the __warndecl uses.

Like the following?  It compiles without warnings and generates the
link warning.

Andreas

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 20:49:15 -0000
@@ -37,4 +37,17 @@ nop (void)
 /* Following here we need an #include for each public header file
    that uses __warndecl.  */
 
+/* Define away to avoid warnings with compilers that do not have these
+   builtins.  */
+#define __builtin___memcpy_chk(dest, src, len, bos) NULL
+#define __builtin___memmove_chk(dest, src, len, bos) NULL
+#define __builtin___mempcpy_chk(dest, src, len, bos) NULL
+#define __builtin___memset_chk(dest, ch, len, bos) NULL
+#define __builtin___stpcpy_chk(dest, src, bos) NULL
+#define __builtin___strcat_chk(dest, src, bos) NULL
+#define __builtin___strcpy_chk(dest, src, bos) NULL
+#define __builtin___strncat_chk(dest, src, len, bos) NULL
+#define __builtin___strncpy_chk(dest, src, len, bos) NULL
+#define __builtin_object_size(bos, level) 0
+
 #include <string.h>

-- 
 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: pgp00000.pgp
Description: PGP signature


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