This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/71255] Implement #pragma may_alias
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 24 May 2016 14:01:47 +0000
- Subject: [Bug c/71255] Implement #pragma may_alias
- Auto-submitted: auto-generated
- References: <bug-71255-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71255
--- Comment #11 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 #10 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
> Well, so far my plan is to gather symbols in
> #pragma GCC may_alias SYMBOL
> to some vector of symbols and then when declaring a SYMBOL check if it's in the
> vector and if so, apply the may_alias attribute. Now, as Richi points out,
> I'll probably have to introduce two variants:
>
> #pragma GCC may_alias SYMBOL
> #pragma GCC may_alias struct SYMBOL
>
> The symbols in the vector would serve as a "tentative" forward declaration.
>
> Do you see any problems with that?
Not really but a
#pragma GCC tentative
struct sockaddr __attribute__((may_alias));
would then also allow for other attributes to be tentatively added so
that might be a little less special.