#4 _NULL define causes compilation error in cygwin

open
nobody
None
5
2012-10-24
2012-10-24
Anonymous
No

cygwin include headers set _NULL define:
/usr/include/sys/reent.h:16:#define _NULL 0

this causes a compile error in parse.cc due to preprocessor expansion:

g++ -DHAVE_CONFIG_H -I. -I.. -I../libltdl -g -O2 -MT parse.o -MD -MP -MF .deps/parse.Tpo -c -o parse.o parse.cc
In file included from parse.yy:539:0:
parse.h:579:0: warning: "_NULL" redefined
/usr/include/sys/reent.h:16:0: note: this is the location of the previous definition
In file included from parse.yy:539:0:
parse.h:281:6: error: expected identifier before numeric constant
parse.h:281:6: error: expected ‘}’ before numeric constant
parse.h:281:6: error: expected unqualified-id before numeric constant
parse.h:336:4: error: expected declaration before ‘}’ token
Makefile:439: recipe for target `parse.o' failed

renaming _NULL (to _MYNULL) in src/parse.* src/lex.* solves this issue

Discussion