[Bug c/38457] New: -Wattributes gives warnings for portable code for default-packed architectures.
hp at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Dec 9 19:43:00 GMT 2008
c-common.c:handle_packed_attribute about line 5117 gives a warning for types
where __attribute__ ((__packed__)) is applied but has no effect. That
particular warning should be removed or perhaps moved to a separate flag,
because it emits warnings for code such as:
struct x
{
char c;
int x __attribute__ ((__packed__));
};
*depending on the target ABI*, i.e. it will always warn for a target where the
default layout corresponds to the packed layout (example cut down from generic
code in glibc-2.9). Worse, this warning is on by default.
I know someone will jump up and tell me to remove the attribute in the code,
but it doesn't work that way: editing the code is not appropriate (example cut
down from generic code in glibc). Neither is shutting off *all*
attribute-warnings using -Wno-attributes. Observed with [trunk revision
142601] and [gcc-4_3-branch revision 135713].
--
Summary: -Wattributes gives warnings for portable code for
default-packed architectures.
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hp at gcc dot gnu dot org
GCC target triplet: cris-*-* and crisv32-*-* and other default-packed arches
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38457
More information about the Gcc-bugs
mailing list