Flex C++ lexer redefines stdint.h macros
Win flex-bison is a port Flex & Bison tools to the Windows platform
Brought to you by:
lexxmark
Compiling a C++ lexer from Flex produces warnings that the INT*_MIN, INT*_MAX and UINT*_MAX macros from stdint.h have been redefined. When I inspected Flex's generated code, I found a block guarded by #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L which defines Flex's names for integer types. The catch is, C++ compilers don't always define that symbol, but do define the fixed-size integer types (in cstdlib.) So, a C++ compiler defines the macros itself, then includes cstdlib where they're defined again.
Anonymous
Diff:
Diff:
Diff:
1
1
1
1
1
1
Diff:
1
1
1
1
1
1
Diff: