This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/44420] [feature request] Warn for certain integer overflows



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]