Fixed diagnostic messages on enumerator overflow.

An enumerator that would be incremented greater than ULONG_MAX now causes an error.
This commit is contained in:
acqn
2022-11-02 14:22:21 +08:00
parent ad7c5a6617
commit deb5e97732
2 changed files with 22 additions and 12 deletions

9
test/err/bug1890.c Normal file
View File

@@ -0,0 +1,9 @@
/* bug #1890 - Overflow in enumerator value is not detected */
#include <limits.h>
enum { a = ULONG_MAX, b } c = b;
int main(void)
{
return 0;
}