http://llvm.org/bugs/show_bug.cgi?id=21472
Bug ID: 21472
Summary: Support/DataTypes.h requires C99 defines even when
compiling in C11 mode
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Support Libraries
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
$ echo '#include <llvm/Support/DataTypes.h>' | clang -std=c11 -xc -
In file included from <stdin>:1:
/usr/include/llvm/Support/DataTypes.h:58:3: error: "Must #define
__STDC_LIMIT_MACROS before #including Support/DataTypes.h"
# error "Must #define __STDC_LIMIT_MACROS before #including
Support/DataTypes.h"
^
/usr/include/llvm/Support/DataTypes.h:62:3: error: "Must #define
__STDC_CONSTANT_MACROS before " "#including Support/DataTypes.h"
# error "Must #define __STDC_CONSTANT_MACROS before " \
^
2 errors generated.
The explanation in DataTypes.h:
"Note that this header's correct operation depends on __STDC_LIMIT_MACROS being
defined. We would define it here, but in order to prevent Bad Things happening
when system headers or C++ STL headers include stdint.h before we define it
here, we define it on the g++ command line (in Makefile.rules)."
I don't think this applies when compiling in C11 mode, e.g. when including this
header from third-party code.
Suggested fix: Surround the error message with "#if __STDC_VERSION__ < 201112L"
or something to that effect.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs