public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/17426] New: Emit mandatory warning for manual expansions of offsetof
@ 2004-09-12  1:37 giovannibajo at libero dot it
  2004-09-12  1:38 ` [Bug c/17426] " giovannibajo at libero dot it
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2004-09-12  1:37 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-03-13  5:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-12  1:37 [Bug c/17426] New: Emit mandatory warning for manual expansions of offsetof giovannibajo at libero dot it
2004-09-12  1:38 ` [Bug c/17426] " giovannibajo at libero dot it
2004-09-12  1:39 ` pinskia at gcc dot gnu dot org
2004-09-12 11:11 ` jsm at polyomino dot org dot uk
2004-09-12 13:29 ` giovannibajo at libero dot it
2004-09-12 14:30 ` jsm at polyomino dot org dot uk
2005-03-13  5:38 ` pinskia at gcc dot gnu dot org
2005-03-13  5:39 ` pinskia 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).