public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alex Henrie <alexhenrie24@gmail.com>
To: Richard Biener <rguenther@suse.de>
Cc: gcc-patches@gcc.gnu.org, msebor@gcc.gnu.org
Subject: Re: [PATCH] PR c/86407 - Add option to ignore fndecl attributes on function pointers
Date: Fri, 24 May 2019 15:49:00 -0000	[thread overview]
Message-ID: <CAMMLpeQZdG26pjY4uu-k1HjHWfw9tDHYBmTupwfeQ21GA8XXpg@mail.gmail.com> (raw)
In-Reply-To: <alpine.LSU.2.20.1905241000280.10704@zhemvz.fhfr.qr>

On Fri, May 24, 2019 at 2:01 AM Richard Biener <rguenther@suse.de> wrote:
>
> I'm not sure we really need a new warning for this.

On Fri, May 24, 2019 at 9:23 AM Martin Sebor <msebor@gmail.com> wrote:
>
> I don't think GCC makes a formal distinction between function
> attributes that affect only function definitions vs those that
> affect its users, or both.  It might be a useful distinction
> to introduce, perhaps even for functions as well as variables,
> but as it is, users (as well as GCC developers) are on our own
> to figure it out.

Then is it preferable to simply silence Wattributes in this case?

On Fri, May 24, 2019 at 2:01 AM Richard Biener <rguenther@suse.de> wrote:
>
> > +int __attribute__((__ms_hook_prologue__)) func(); /* no warnings */
> > +
>
> But this is a declaration?

On Fri, May 24, 2019 at 9:23 AM Martin Sebor <msebor@gmail.com> wrote:
>
> My first question is: what is the meaning of "function definition
> attributes?"  Presumably those that affect only the definition of
> a function and not its callers or other users?

As far as I can tell, "fndecl" is a misnomer: these attributes are
more accurately called "function definition attributes", i.e.
attributes that affect the assembly code of the function but do not
affect its calling convention.

On Fri, May 24, 2019 at 9:23 AM Martin Sebor <msebor@gmail.com> wrote:
>
> Finally, with this as a prerequisite, if we decided that a warning
> like this would be useful, tests to verify that it works for all
> the definition attributes and not for the rest would need to be
> added (i.e., in addition to ms_hook_prologue).

Okay, I will add tests for the other function attributes that should
behave in the same way, commenting out the tests that will require
more work to pass.

The end goal is to include __ms_hook_prologue__ in the WINAPI macro on
Wine without causing spurious warnings. This will go a long way
towards making Wine compatible with current and future Windows
programs. Thank you for help.

-Alex

  reply	other threads:[~2019-05-24 15:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-24  3:57 Alex Henrie
2019-05-24  8:01 ` Richard Biener
2019-05-24 15:49   ` Alex Henrie [this message]
2019-05-25  6:34     ` Richard Biener
2019-05-25 17:20       ` Alex Henrie
2019-05-27  7:26         ` Richard Biener
2019-05-28 19:41     ` Martin Sebor
2019-05-29  7:16       ` Richard Biener
2019-05-30  8:28       ` Alex Henrie
2019-05-31  1:09         ` Joseph Myers
2019-05-31  5:58           ` Alex Henrie
2019-05-31  8:23             ` Richard Biener
2019-05-31 20:47               ` Alex Henrie
2019-06-03  8:25                 ` Richard Biener
2019-06-03 15:17             ` Joseph Myers
2019-05-24 15:23 ` Martin Sebor

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=CAMMLpeQZdG26pjY4uu-k1HjHWfw9tDHYBmTupwfeQ21GA8XXpg@mail.gmail.com \
    --to=alexhenrie24@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=msebor@gcc.gnu.org \
    --cc=rguenther@suse.de \
    /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).