public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ethouris at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/31367] Should not warn about use of deprecated type in deprecated struct
Date: Tue, 18 May 2010 07:15:00 -0000	[thread overview]
Message-ID: <20100518071501.14144.qmail@sourceware.org> (raw)
In-Reply-To: <bug-31367-1313@http.gcc.gnu.org/bugzilla/>



------- Comment #4 from ethouris at gmail dot com  2010-05-18 07:14 -------
No matter which entity is actually affected in the example above, 'foo' is a
type of field used inside the entity. In all these cases, deprecation warning
should not be reported for the field of type 'foo'. It should be reported only
when no part of the structure definition is deprecated.

The difference between deprecating only a typedef for a structure or the
structure itself, but not its typedef, should not be seen when it concerns one
integrated declaration (that is, when you "deprecate" any of these two, both
the typedef and the struct are deprecated). To only deprecate the typedef or
the struct, they should be declared separately - for example, bop4/bar4 should
be declared this way:

struct bar4
{
  foo baz;
};

typedef struct bar4 bop4 __attribute__((deprecated));


So, in the examples for bop1-bop4, all of barN/bopN symbols should be
deprecation-attributed (and, simultaneously, in all these declarations the
deprecation warning should not be reported for 'baz' field declaration). For
this above declaration, the compiler should issue a warning about 'baz' field,
as the structure isn't deprecated and is using a deprecated type 'foo'; so
should be reported a warning about using struct bar4 (this structure is this
way "implicitly deprecated") and bop4 (which is explicitly deprecated).


-- 


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


      parent reply	other threads:[~2010-05-18  7:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-26 18:39 [Bug c++/31367] New: " ian at airs dot com
2007-03-26 18:43 ` [Bug c/31367] " pinskia at gcc dot gnu dot org
2007-03-26 20:27 ` david at luyer dot net
2007-03-26 23:57 ` spark at gcc dot gnu dot org
2010-05-18  7:15 ` ethouris at gmail dot com [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100518071501.14144.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).