From: Pedro Alves <pedro@palves.net>
To: Simon Marchi <simon.marchi@polymtl.ca>,
Andrew Burgess <andrew.burgess@embecosm.com>,
gdb-patches@sourceware.org
Subject: Re: [PATCH] gdbsupport: better detection of -Wmissing-prototypes support
Date: Fri, 24 Sep 2021 15:30:33 +0100 [thread overview]
Message-ID: <d571a654-87b2-74ec-875f-dd89e6f90d8f@palves.net> (raw)
In-Reply-To: <4640bbdc-4b51-dab4-a730-3549a3b75807@polymtl.ca>
On 2021-09-24 3:22 p.m., Simon Marchi wrote:
>
>
> On 2021-09-24 10:06 a.m., Pedro Alves wrote:
>> On 2021-09-24 2:40 p.m., Simon Marchi via Gdb-patches wrote:
>>> On 2021-09-24 9:16 a.m., Andrew Burgess wrote:
>>>> It has been pointed out to me on IRC (thanks Simon), that this issue
>>>> is not GCC, but ccache:
>>>>
>>>> https://github.com/ccache/ccache/issues/738#issuecomment-740133374
>>>>
>>>> So this patch certainly shouldn't go in as it is currently written.
>>>>
>>>> It's still pretty annoying seeing those warnings though, so I wonder
>>>> if we can consider having a work around for this ccache issue in the
>>>> GDB configure scripts?
>>>>
>>>> Maybe something as simple as setting CCACHE_DISABLE in the environment
>>>> prior to running the AM_GDB_WARNINGS checks?
>>>>
>>>> All ideas welcome...
>>>
>>> Either way would be fine with me:
>>>
>>> - to use AC_LINK_IFELSE all the time (I don't think the execution time
>>> would be significantly higher)
>>> - to set CCACHE_DISABLE during the execution of AM_GDB_WARNINGS
>>
>> Does working around this in configure tests still mean that when using ccache
>> for really building gdb, ccache will still misreorder arguments and thus
>> potentially a -Wmissing-prototypes warning would not be turned into an error?
>
> I think it's only the "-Wmissing-prototypes is useless in C++" warning
> that has this order problem. If you were compiling something in C and
> was missing a prototype, that warning would be not be affected by the
> order bug (although I haven't tried).
>
> By working around in the problem in configure, that means
> -Wmissing-prototypes will not be present when compiling with GCC (as it
> does nothing in C++), so there's nothing to miss here.
>
>> So, here's another option, I think:
>>
>> #3 - drop -Wmissing-prototypes completely.
>>
>> As the GCC warning says,
>>
>> cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++
>>
>> it's only valid for C, not C++. Do we compile anything with a C compiler nowadays?
>
> It's there because it does something for clang in C++, see:
>
> https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=a0761e34f054767de6d6389929d27e9015fb299b
>
> If we find that the rationale for having it there isn't valid anymore,
> we can remove it.
How about skipping checking for -Wmissing-prototypes support if compiling with gcc then?
next prev parent reply other threads:[~2021-09-24 14:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-24 12:29 Andrew Burgess
2021-09-24 13:16 ` Andrew Burgess
2021-09-24 13:40 ` Simon Marchi via Gdb-patches
2021-09-24 14:06 ` Pedro Alves
2021-09-24 14:22 ` Simon Marchi via Gdb-patches
2021-09-24 14:30 ` Pedro Alves [this message]
2021-09-24 14:55 ` Simon Marchi via Gdb-patches
2021-09-24 15:09 ` Pedro Alves
2021-09-24 15:14 ` [PATCHv2] " Andrew Burgess
2021-10-25 14:50 ` Simon Marchi via Gdb-patches
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=d571a654-87b2-74ec-875f-dd89e6f90d8f@palves.net \
--to=pedro@palves.net \
--cc=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/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