This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/17426] New: Emit mandatory warning for manual expansions of offsetof
- From: "giovannibajo at libero dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Sep 2004 01:37:49 -0000
- Subject: [Bug c/17426] New: Emit mandatory warning for manual expansions of offsetof
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
RTH's patch for PR 17396 reintroduced support for the old-skool manual
expansion of offsetof within constant expression - a thing which is forbidden
by C90 rules and that we will stop accepting one day.
Meanwhile, it makes sense to warn people about this change, since it is a
widespread idiom. I propose a mandatory warning to be emitted in this case:
warning: this custom definition of offsetof is not a valid constant expression
in ISO C
info: use the offsetof macro from <stddef.h> to disable this warning
JSM, I would appreciate your comments on this PR (especially, the wording of
the message, pedwarn vs warn, mandatory or not), before I write up the patch.
--
Summary: Emit mandatory warning for manual expansions of offsetof
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: giovannibajo at libero dot it
ReportedBy: giovannibajo at libero dot it
CC: gcc-bugs at gcc dot gnu dot org,jsm28 at gcc dot gnu dot
org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17426