glob.h syntax errors

Andreas Schwab schwab@suse.de
Thu Sep 16 23:30:00 GMT 2004


When <glob.h> is included as the first header it produces lots of syntax
errors:

$ echo '#include <glob.h>' | gcc -c -xc - -o /dev/null
In file included from <stdin>:1:
/usr/include/glob.h:177: error: parse error before "__THROW"
/usr/include/glob.h:180: error: parse error before "__THROW"
$ echo '#include <glob.h>' | gcc -c -xc - -o /dev/null -D_LARGEFILE64_SOURCE
In file included from <stdin>:1:
/usr/include/glob.h:177: error: parse error before "__THROW"
/usr/include/glob.h:180: error: parse error before "__THROW"
/usr/include/glob.h:193: error: parse error before "__THROW"
/usr/include/glob.h:195: error: parse error before "__THROW"
$ echo '#include <glob.h>' | gcc -c -xc - -o /dev/null -D_FILE_OFFSET_BITS=64
In file included from <stdin>:1:
/usr/include/glob.h:182: error: parse error before '(' token
/usr/include/glob.h:184: error: `__REDIRECT_NTH' declared as function returning a function
/usr/include/glob.h:185: error: `glob_t' redeclared as different kind of symbol
/usr/include/glob.h:129: error: previous declaration of `glob_t'
/usr/include/glob.h:185: error: parse error before '*' token
/usr/include/glob.h:187: error: parse error before '(' token
/usr/include/glob.h:187: error: conflicting types for `__REDIRECT_NTH'
/usr/include/glob.h:184: error: previous declaration of `__REDIRECT_NTH'
/usr/include/glob.h:187: error: parse error before ')' token

Shouldn't it include <sys/cdefs.h>?

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Libc-hacker mailing list