Test case for const-overflow warnings

This commit is contained in:
bbbradsmith 2023-05-03 19:54:40 -04:00
parent 8e75e5b51a
commit b5f255f912
1 changed files with 20 additions and 0 deletions

View 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;
}