This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/44420] [feature request] Warn for certain integer overflows
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jun 2010 17:34:43 -0000
- Subject: [Bug c/44420] [feature request] Warn for certain integer overflows
- References: <bug-44420-9973@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2010-06-07 17:34 -------
> foo = bar << 20;
Yes this can overflow but so can "bar * 2" and "bar + 1". Maybe I am missing
something here because we don't warn for those cases. Do you want a warning
where the assignment happens to be a wider type? That is:
uint64_t = uint32_t OP uint32_t; With an implicit casting to uint64_t?
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Component|middle-end |c
Keywords| |diagnostic
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44420