------- 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

Reply via email to