mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-11-19 03:07:00 +00:00
27 lines
1010 B
C++
27 lines
1010 B
C++
/* Deviance Test 2.7.1.2: Ensure long integer constant overflows are */
|
|
/* caught as errors */
|
|
main ()
|
|
{
|
|
long a;
|
|
|
|
a = 2147483648;
|
|
a = -2147483648L;
|
|
a = 0xFFFFFFFF2;
|
|
a = 0x800000001;
|
|
a = 047777777777L;
|
|
|
|
/* octal number with more than 255 characters */
|
|
a = 000000000000000000000000000000000000000000000000000000000000\
|
|
0000000000000000000000000000000000000000000000000000000000000000000\
|
|
0000000000000000000000000000000000000000000000000000000000000000000\
|
|
00000000000000000000000000000000000000000000000000000000000003;
|
|
|
|
/* hex number with more than 255 characters */
|
|
a = 0x0000000000000000000000000000000000000000000000000000000000\
|
|
0000000000000000000000000000000000000000000000000000000000000000000\
|
|
0000000000000000000000000000000000000000000000000000000000000000000\
|
|
00000000000000000000000000000000000000000000000000000000000003FF0110;
|
|
|
|
printf ("Failed Deviance Test 2.7.1.2\n");
|
|
}
|