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

             Bug #: 53514
           Summary: Make -Wpadded a meta-option for -Wpadded-in-middle and
                    -Wpadded-at-end
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: da...@doublewise.net


"Warn if padding is included in a structure, either to align an element of the
structure or to align the whole structure. Sometimes when this happens it is
possible to rearrange the fields of the structure to reduce the padding and so
make the structure smaller."

I would find this warning much more useful if it were two different warnings,
-Wpadded-in-middle and -Wpadded-at-end.

-Wpadded-at-end would only warn if padding was added to the end of the
structure. This could theoretically be useful to let you know about structures
that you can add data to "for free" in terms of size.

What I'm more interested in, however, is -Wpadded-in-middle. This is what
suggests that perhaps you could reduce the size of the structure by changing
the order of the elements.

This suggestion would make -Wpadded become equivalent to -Wpadded-in-middle
-Wpadded-at-end.

Reply via email to