public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/38457] New: -Wattributes gives warnings for portable code for default-packed architectures.
@ 2008-12-09 19:43 hp at gcc dot gnu dot org
2008-12-09 23:29 ` [Bug c/38457] " rguenth at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-12-09 19:43 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c/38457] -Wattributes gives warnings for portable code for default-packed architectures.
2008-12-09 19:43 [Bug c/38457] New: -Wattributes gives warnings for portable code for default-packed architectures hp at gcc dot gnu dot org
@ 2008-12-09 23:29 ` rguenth at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-12-09 23:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2008-12-09 23:19 -------
Confirmed. The warning isn't useful for targets that always pack.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |diagnostic
Last reconfirmed|0000-00-00 00:00:00 |2008-12-09 23:19:26
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38457
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-12-09 23:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-09 19:43 [Bug c/38457] New: -Wattributes gives warnings for portable code for default-packed architectures hp at gcc dot gnu dot org
2008-12-09 23:29 ` [Bug c/38457] " rguenth at gcc dot gnu dot 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).