gcc dislikes this prefix to a program depending on C99 integer division: $ cat bug.c #if 1/-2 || (-1)/2 # error "integer division rounding away from zero not supported" #endif $ gcc-4.2.2 -fsyntax-only bug.c bug.c:1:12: warning: integer overflow in preprocessor expression bug.c:1:21: warning: integer overflow in preprocessor expression
It doesn't complain about #if 1/2 || (-1)/(-2), nor nonzero expressions #if 3/-2 || (-3)/2. (Well, the latter reaches the #error directive of course.) Checked for gcc 4.2.2, 4.0.2 and 3.4.6. -- Summary: wrong #if 1/-2 and (-1)/2 overflow warnings Product: gcc Version: 4.2.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: h dot b dot furuseth at usit dot uio dot no GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36123