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/68007] New: False warning for integer overflow for unsigned integers


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


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