[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cpp oddness



> The output of "cpp test.c" on the attached file:

And cpp -Wundef test.c:

# 1 "test.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "test.c"
test.c:5:2: warning: #warning TEST_FIVE defined
test.c:8:2: warning: #warning TEST_NINE defined
# 15 "test.c"
test.c:24:6: warning: "TEST_FOUR" is not defined
test.c:24:19: warning: "TEST_SEVEN" is not defined
test.c:25:2: warning: #warning 4 and 7 claim to be equal
enum __stuff { TEST_FOUR = 4, TEST_SEVEN = 7 };
# 28 "test.c"
test.c:33:2: warning: #warning TEST_THREE defined
test.c:36:2: warning: #warning TEST_EIGHT defined
test.c:39:6: warning: "TEST_THREE" is not defined
test.c:39:20: warning: "TEST_EIGHT" is not defined
test.c:40:2: warning: #warning 3 and 8 claim to be equal
enum __stuffandnonsense { TEST_THREE = 3, TEST_EIGHT = 8 };

Note the contradiction.



Reply to: