public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/68007] New: False warning for integer overflow for unsigned integers
@ 2015-10-17 21:06 r.f.vannieuwpoort at student dot tudelft.nl
  2015-10-17 22:12 ` [Bug c/68007] " schwab@linux-m68k.org
  0 siblings, 1 reply; 2+ messages in thread
From: r.f.vannieuwpoort at student dot tudelft.nl @ 2015-10-17 21:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68007

            Bug ID: 68007
           Summary: False warning for integer overflow for unsigned
                    integers
           Product: gcc
           Version: 4.8.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: r.f.vannieuwpoort at student dot tudelft.nl
  Target Milestone: ---

The assignment of 0x7fffffff + 1 to a 32-bit unsigned integer causes a false
warning for an integer overflow (it would overflow if it was assigned to a
signed integer).

Example: uint32_t a = 0x7fffffff + 1

Compileable example:
#include <stdint.h>
int main(int argc, char *argv[])
{
    uint32_t a = 0x7fffffff + 1;
    return 0;
}


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c/68007] False warning for integer overflow for unsigned integers
  2015-10-17 21:06 [Bug c/68007] New: False warning for integer overflow for unsigned integers r.f.vannieuwpoort at student dot tudelft.nl
@ 2015-10-17 22:12 ` schwab@linux-m68k.org
  0 siblings, 0 replies; 2+ messages in thread
From: schwab@linux-m68k.org @ 2015-10-17 22:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68007

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Andreas Schwab <schwab@linux-m68k.org> ---
0x7fffffff is of type int, and 0x7fffffff + 1 will overflow a 32-bit int.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-17 22:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-17 21:06 [Bug c/68007] New: False warning for integer overflow for unsigned integers r.f.vannieuwpoort at student dot tudelft.nl
2015-10-17 22:12 ` [Bug c/68007] " schwab@linux-m68k.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).