This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Builtin functions wrongly expanded (egcs-1.1.2, Red Hat 6.0)
- To: Michael Smith <michael at csuite dot ns dot ca>
- Subject: Re: Builtin functions wrongly expanded (egcs-1.1.2, Red Hat 6.0)
- From: Zack Weinberg <zack at bitmover dot com>
- Date: Sat, 25 Sep 1999 12:58:45 -0700
- cc: gcc-bugs at gcc dot gnu dot org
- References: <Pine.LNX.4.10.9909251631110.1866-101000@pentagram.nslug.ns.ca>
Michael Smith wrote:
>
> We're running Red Hat 6.0 (standard egcs-1.1.2-12 RPM). Compilation of
> wu-ftpd (2.4.2-beta18 - long story) fails in a function where strpbrk() is
> redeclared (er, redefined? been a while since I read a C text...) because
> cpp expands it.
>
> Here's a code snippet to reproduce:
>
> #include <string.h>
>
> int
> main(int argc, char **argv)
> {
> char *strpbrk(const char *, const char *);
>
> return 0;
> }
(a) This is a libc issue, not a gcc issue. gcc does not provide
string.h.
(b) This code is illegal according to the C standard. Once
string.h has been included, all identifiers declared by string.h may
not be used again for any purpose other than using them as designed -
i.e. you can *call* strpbrk, but you can't redeclare it.
(c) You can work around the problem by defining __NO_STRING_INLINES
before including string.h.
zw