Fix some issues with signedness in preprocessor expressions. Do also disallow
comma expressions since the aren't compliant and collide with macro invocations.
This commit is contained in:
3
test/err/bug2523.c
Normal file
3
test/err/bug2523.c
Normal file
@@ -0,0 +1,3 @@
|
||||
#if (1, 0) < 0
|
||||
#error
|
||||
#endif
|
||||
29
test/val/bug2523.c
Normal file
29
test/val/bug2523.c
Normal file
@@ -0,0 +1,29 @@
|
||||
#if (0u - 1) < 0
|
||||
#error
|
||||
#endif
|
||||
|
||||
#if !1u - 1 > 0
|
||||
#error
|
||||
#endif
|
||||
|
||||
#if (1 & 1u) - 2 < 0
|
||||
#error
|
||||
#endif
|
||||
|
||||
#if (1 | 1u) - 2 < 0
|
||||
#error
|
||||
#endif
|
||||
|
||||
#if (1 ^ 1u) - 2 < 0
|
||||
#error
|
||||
#endif
|
||||
|
||||
#if (1u >> 1) - 2 < 0
|
||||
#error
|
||||
#endif
|
||||
|
||||
#if (0u << 1) - 1 < 0
|
||||
#error
|
||||
#endif
|
||||
|
||||
int main() { return 0; }
|
||||
Reference in New Issue
Block a user