public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Iain Sandoe <iain@sandoe.co.uk>
To: Jakub Jelinek <jakub@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] libgcc: Avoid warnings on __gcc_nested_func_ptr_created [PR113402]
Date: Thu, 1 Feb 2024 20:00:55 +0000	[thread overview]
Message-ID: <60D36C74-5608-4CBC-B2E4-E0825BD6B7CE@sandoe.co.uk> (raw)
In-Reply-To: <CAFiYyc16iEGh9GWvxU431nTLzqO=DEmb3GG6MkWJakFd5Zkepg@mail.gmail.com>



> On 1 Feb 2024, at 08:51, Richard Biener <richard.guenther@gmail.com> wrote:
> 
> On Thu, Feb 1, 2024 at 9:23 AM Jakub Jelinek <jakub@redhat.com> wrote:
>> 
>> On Wed, Jan 31, 2024 at 01:04:20PM +0100, Jakub Jelinek wrote:
>>> On Sun, Jan 28, 2024 at 11:02:33AM +0000, Iain Sandoe wrote:
>>>>    * config/aarch64/heap-trampoline.c: Rename
>>>>    __builtin_nested_func_ptr_created to __gcc_nested_func_ptr_created and
>>>>    __builtin_nested_func_ptr_deleted to __gcc_nested_func_ptr_deleted.
>>>>    * config/i386/heap-trampoline.c: Likewise.
>>>>    * libgcc2.h: Likewise.
>>> 
>>> I'm seeing hundreds of
>>> In file included from ../../../libgcc/libgcc2.c:56:
>>> ../../../libgcc/libgcc2.h:32:13: warning: conflicting types for built-in function ‘__gcc_nested_func_ptr_created’; expected ‘void(void *, void *, void *)’ [-Wbuiltin-declaration-mismatch]
>>>   32 | extern void __gcc_nested_func_ptr_created (void *, void *, void **);
>>>      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> warnings.
>>> 
>>> Either we need to add like in r14-6218
>>> #pragma GCC diagnostic ignored "-Wbuiltin-declaration-mismatch"
>>> (but in that case because of the libgcc2.h prototype (why is it there?)
>>> it would need to be also with #pragma GCC diagnostic push/pop around),
>>> or we could go with just following how the builtins are prototyped on the
>>> compiler side and only cast to void ** when dereferencing (which is in
>>> a single spot in each TU).
>> 
>> Bootstrapped/regtested on x86_64-linux and i686-linux successfully.
> 
> Looks obvious to me.

Thanks, also tested on x86_64 darwin; I guess having typed pointers on the builtins
would be a pretty tricky change.

Iain

> 
> Richard.
> 
>>> 2024-01-31  Jakub Jelinek  <jakub@redhat.com>
>>> 
>>>      * libgcc2.h (__gcc_nested_func_ptr_created): Change type of last
>>>      argument from void ** to void *.
>>>      * config/i386/heap-trampoline.c (__gcc_nested_func_ptr_created):
>>>      Change type of dst from void ** to void * and cast dst to void **
>>>      before dereferencing it.
>>>      * config/aarch64/heap-trampoline.c (__gcc_nested_func_ptr_created):
>>>      Likewise.
>> 
>>        Jakub


      reply	other threads:[~2024-02-01 20:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 14:59 [PATCH v3] Fix __builtin_nested_func_ptr_{created,deleted} symbol versions [PR113402] Iain Sandoe
2024-01-18 15:05 ` Jakub Jelinek
2024-01-28 11:02   ` Iain Sandoe
2024-01-31 12:04     ` [PATCH] libgcc: Avoid warnings on __gcc_nested_func_ptr_created [PR113402] Jakub Jelinek
2024-02-01  8:22       ` Jakub Jelinek
2024-02-01  8:51         ` Richard Biener
2024-02-01 20:00           ` Iain Sandoe [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=60D36C74-5608-4CBC-B2E4-E0825BD6B7CE@sandoe.co.uk \
    --to=iain@sandoe.co.uk \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /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).