[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-readline] "this function declaration is not a prototype" warnin
Re: [Bug-readline] "this function declaration is not a prototype" warning with clang 4
Mon, 29 May 2017 16:07:58 -0400
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.1.1
On 5/26/17 1:18 PM, Roman Bogorodskiy wrote:
> In combination with -Werror it causes build failure. I've checked the
> 'devel' branch of readline and rltypedefs.h looks the same (at least
> relevant parts of it).
> This works for me if I change it too:
> typedef int Function (void) __attribute__ ((deprecated));
> and other typedefs in a similar way.
But that's not how they're used, or the appropriate fix. They're not used
by readline itself at all, only by applications that use it. The idea is
that these exist for long-ago backwards compatibility -- and there are
still existing applications that use them as typedefs for function-with-an-
unknown-number-of-arguments-with-a-particular-return-type. I discovered
this when I tried to remove the old typedefs in readline-6.3, back in 2013,
and I had to add them back in with readline-6.3 patch 5.
If you want to avoid this, you can add -D_FUNCTION_DEF to the CFLAGS you
use to build whatever application you want to link with readline.
(I know, I know, I announced they were deprecated almost 17 years ago:
applications are still catching up. Lots of apps changed in 2014 after I
removed them, but there were enough that did not, or would not, that I
added them back.)
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/
Description: OpenPGP digital signature