This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


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

Re: [civhr@civ.hw.ac.uk] libc/1178: Multiple declaration of strnlen


   Date: Fri, 25 Jun 1999 15:48:29 +0100
   From: Hannes Reinecke <H.Reinecke@hw.ac.uk>

   Andreas Jaeger wrote:
   > 
   > This small program:
   > #include <string.h>
   > 
   > int
   > main (void)
   > {
   > }
   > 
   > shows the problem reported in the appended bug report if you compile
   > with:
   > 
   > gcc -D_GNU_SOURCE -O2 -Wall -W -Wredundant-decls -c  strlen-test.c
   > In file included from /usr/include/string.h:346,
   >                  from strlen-test.c:1:
   > /usr/include/bits/string2.h:946: warning: redundant redeclaration of `strnlen' in same scope
   > /usr/include/string.h:212: warning: previous declaration of `strnlen'
   > 
   > What shall we do?
   > 

   What about my proposal ?

   #if defined(__USE_GNU) && defined(__NO_STRING_INLINES)
   extern size_t strnlen __P ((__const char *__string, size_t __maxlen));
   #endif

   Because we should only need it if the inlined version should _not_ be
   used.
   Or is there some requirements to have it always defined in string.h ?
   (After all, this is a GNU extension, innit ?)

Yes, and therefore we should simply remove the prototype for strnlen
from bits/string.h.

Mark

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