This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Commit: PR 22823: Fix gcc 8 compile time warnings
- From: Alan Modra <amodra at gmail dot com>
- To: "Maciej W. Rozycki" <macro at mips dot com>
- Cc: Nick Clifton <nickc at redhat dot com>, binutils at sourceware dot org
- Date: Wed, 14 Feb 2018 17:26:42 +1030
- Subject: Re: Commit: PR 22823: Fix gcc 8 compile time warnings
- Authentication-results: sourceware.org; auth=none
- References: <8760716n3w.fsf@redhat.com> <alpine.DEB.2.00.1802140209380.3553@tp.orcam.me.uk>
On Wed, Feb 14, 2018 at 02:59:34AM +0000, Maciej W. Rozycki wrote:
> For some host psABIs I suppose initialising a fixed-argument function
> pointer with a variable-argument function reference and then using the
> pointer to make a call is going to work, but this is UB AFAIK as per the C
> language standard, so I suggest that you revert your change and look for a
> better alternative, as the cure seems worse than the disease.
>
> NB I don't know where the idea of complaining about extraneous function
> arguments has come from for GCC 8 (except maybe for `-pedantic'), as this
> property of the C vs Pascal function calling convention has been relied on
> since forever.
Wow, what a horrible gcc warning. A warning for casts from a function
taking no argument, but no warning for casts from a variadic to
non-variadic function!
--
Alan Modra
Australia Development Lab, IBM