This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

Re: Builtin functions wrongly expanded (egcs-1.1.2, Red Hat 6.0)


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


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