mirror of
https://github.com/cc65/cc65.git
synced 2025-03-13 15:32:09 +00:00
Test case for const-overflow warnings
This commit is contained in:
parent
8e75e5b51a
commit
b5f255f912
20
test/err/integer-const-overflow.c
Normal file
20
test/err/integer-const-overflow.c
Normal file
@ -0,0 +1,20 @@
|
||||
/* Integer constant overflow warnings. */
|
||||
|
||||
/* Warnings as errors. */
|
||||
#pragma warn(error,on)
|
||||
|
||||
/* Warn on const overflow */
|
||||
#pragma warn(const-overflow,on)
|
||||
|
||||
unsigned char a = 256;
|
||||
signed char b = 128;
|
||||
unsigned char c = -129;
|
||||
unsigned short int d = 0x00010000;
|
||||
unsigned short int e = 0x80000000;
|
||||
signed short int f = 32768L;
|
||||
signed short int g = -32769L;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user