[Bug c/54032] New: The C compiler does not warn about casts to more aligned types

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jul 19 13:22:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54032

             Bug #: 54032
           Summary: The C compiler does not warn about casts to more
                    aligned types
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org


struct Foo
{
  char c;
  int i;
} __attribute__((packed));

int *foo(struct Foo *p)
{
  return &p->i;
}

does not warn with -W -Wall -Wcast-align.



More information about the Gcc-bugs mailing list