https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71255

--- Comment #8 from rguenther at suse dot de <rguenther at suse dot de> ---
On Tue, 24 May 2016, mpolacek at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71255
> 
> --- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
> But before I start, do y'all feel like this attribute should be applicable too
> all symbols the may_alias attribute is applicable to?  I.e. not just structs,
> but other decls, too.

While a pragma might work I'd say for the case in question we'd like to
have a "tentative" forward declaration that can be merged with subsequent
forward declarations but isn't found itself by name lookup until
declared itself.

In any case consider what happens for a program doing

int sockaddr = 1;

or

void sockaddr (void) {}

that is, a program using the identifier for sth that is not close
enough to 'struct sockaddr'.  One option is to ignore the pragma
for non-structs if it said 'struct sockaddr' for example.

Reply via email to