This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Re: [civhr@civ.hw.ac.uk] libc/1178: Multiple declaration of strnlen
- To: Andreas Jaeger <aj@arthur.rhein-neckar.de>
- Subject: Re: [civhr@civ.hw.ac.uk] libc/1178: Multiple declaration of strnlen
- From: Hannes Reinecke <H.Reinecke@hw.ac.uk>
- Date: Fri, 25 Jun 1999 15:48:29 +0100
- CC: libc-alpha Mailinglist <libc-alpha@sourceware.cygnus.com>
- Organization: Heriot Watt University, Edinburgh
- References: <u8zp1omkgi.fsf@arthur.rhein-neckar.de>
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 ?)
Cheers,
Hannes
--
Hannes Reinecke <civhr@civ.hw.ac.uk>
Fluid Loading and Instrumentation Center Tel: (+44) 131 451 3149
Dept. of Civil & Offshore Engineering Fax: (+44) 131 451 3154
Heriot Watt University, Edinburgh EH14 4AS