Merge pull request #2084 from bbbradsmith/numerical_constant_errors-int

Numerical constant errors and improvements (integer)
This commit is contained in:
Bob Andrews
2023-05-06 21:36:59 +02:00
committed by GitHub
9 changed files with 77 additions and 7 deletions

View File

@@ -0,0 +1,7 @@
/* too big for internal integer representation */
unsigned long huge = 4294967296;
int main(void)
{
return 0;
}

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