home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 14 Text
/
14-Text.zip
/
C6_BUGS.ZIP
/
C6_20094.BUG
< prev
next >
Wrap
Text File
|
1990-09-11
|
2KB
|
73 lines
Q65302 Warning C4056: "Overflow in Constant Arithmetic" May Be Wrong
Microsoft C Compiler (C)
6.00 | 6.00
MS-DOS | OS/2
Summary:
The compiler warning "C4056: Overflow in constant arithmetic" can be
generated by the C 6.00 compiler erroneously. This message is
generated on warning level 2 or higher. If the Quick Compiler (/qc) is
used, the error does not occur.
Sample Code
-----------
// This code fragment will generate the C4056 error on the
// the two lines that reference rate_file.factor14[8][ctr]
#include <string.h>
struct PC_RATE_FILE
{
char kind[3];
char state[3];
char rate_date[7];
long base[20];
long factor01[40][20];
long factor02[40][20];
long factor03[40][20];
long factor04[40][20];
long factor07[40][20];
long factor08[40][20];
long factor09[40][20];
long factor10[40][20];
long factor11[40][20];
long factor12[40][20];
char factor14[40][20][8];
long factor15[40][20];
char valid_year[15][3];
char valid_terr[40][3];
char valid_class[40][3];
} rate_file;
int testit()
{
long ctr;
char test_string[80],*ptr;
long test_rel;
for (ctr=0;ctr<6;ctr++)
{
ptr = (char *)rate_file.factor14[8][ctr];
strcpy (test_string,rate_file.factor14[8][ctr]);
test_rel = rate_file.factor15[7][ctr];
}
return(1);
}
Microsoft has confirmed this to be a problem with C version 6.00. We
are researching this problem and will post new information here as it
becomes available.
/*
/* MSINTERNAL:
/* Filtered by: bryant
/*
/* BUG INFO - Not raided due to several similar bugs in the database.
Keywords: buglist6.00
COPYRIGHT Microsoft Corporation, 1990.
Updated 90/09/01 08:26