2017-10-21 18:40:19 -05:00
|
|
|
/* Deviance Test 2.7.1.2: Ensure long integer constant overflows are */
|
|
|
|
/* caught as errors */
|
2022-10-17 17:50:42 -05:00
|
|
|
|
|
|
|
int printf(const char *, ...);
|
|
|
|
|
|
|
|
int main (void)
|
2017-10-21 18:40:19 -05:00
|
|
|
{
|
|
|
|
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");
|
|
|
|
}
|