------- Additional Comments From qiyaoltc at cn dot ibm dot com 2005-08-29 05:00 ------- I add suffix f to the end of float constants at line 5 and line 7, and add option -pedantic, the output from gcc is like this:
overflow-test.c:5: warning: floating constant exceeds range of "float" overflow-test.c:9: warning: floating constant exceeds range of "double" overflow-test.c:13: warning: integer constant is too large for "long" type overflow-test.c:13: warning: overflow in implicit constant conversion It seems that gcc has checked initialization which caused overflow, but do not check underflow, that is to say: 1 GCC does not check underflow event, at least options -pedantic does not enable underflow check. 2 If there is some mechanism in GCC internal to check underflow and overflow, there is a bug in gcc info about the description of -Wextra option. Could you tell me what I could do to this problem? Maybe, it is impossible for me to fix it, but I just want to do something more. Please give me some suggestions and I will try to do it. Thanks. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23572