This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/19978] overflow in expression of constants should not cause multiple warnings
- From: "schlie at comcast dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jan 2007 15:04:10 -0000
- Subject: [Bug c/19978] overflow in expression of constants should not cause multiple warnings
- References: <bug-19978-230@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from schlie at comcast dot net 2007-01-06 15:04 -------
It seems that an overflow warning should be generated if an overflowed value
is utilized or results from an expression evaluation between sequence ponts?
Thereby:
x = INT_MAX + 2 - 2 ; // warning x may overflow.
z = (y = x +1, y - 2) ; // warning y may overflow, warning z may overflow.
if (z < INT_MAX) {<something>} // warning if may overflow.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19978