[Dev-C++] Warning when compiling constant expression
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: David M. <ci...@ya...> - 2003-10-25 18:53:47
|
A line in my program reads const unsigned long prime_product = 3 * 5 * 7 * 11 * 13 * 17 * 19 * 23 * 29; When compiling in Linux (g++ 3.3.1) I get the warning factor.cpp:12: warning: integer overflow in expression I figure it is using signed integers as temporary variables so I try. const unsigned long prime_product = 3234846615; //3234846615 is the result of the above calculation. Now I get this warning. factor.cpp:12: warning: this decimal constant is unsigned only in ISO C90 My code assumes a 32-bit system, which means an unsigned int is capable of storing 2^32 (4,294,967,296) which is greater then the number I am attempting to store in it? These are just warnings but I still want to figure out why I am getting them. Thanks in Advance David McKen __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com |