[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #2 [Was: Re: Function attributes for make-docfile]

From: Paul Eggert
Subject: Re: #2 [Was: Re: Function attributes for make-docfile]
Date: Wed, 14 Jan 2015 11:44:26 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 01/14/2015 09:49 AM, Stefan Monnier wrote:
This is hideous.  Why do we need that?

Assuming --enable-gcc-warnings, it's a combination of things. First, gcc -Wsuggest-attribute=const complains if it can deduce that an extern function is const but the function wasn't declared const. Second, this particular function is const on some platforms and not on others, so we can't simply declare it to be const everywhere. Third, the DEFUN syntax doesn't give us a way to declare a function const only on some platforms. Fourth, gcc -Wredundant-decls won't let us supply another extern declaration by hand, with the const attribute on platforms that need const, because GCC complains if there are duplicate extern declations.

There are several possibilities for how to fix this in a less-ugly way, including:

1.  Omit -Wsuggest-attribute=const.

2.  Omit -Wredundant-decls.

3.  Make make-docfile.c even smarter and/or trickier.

The attached patch would do (2), as I expect this is simplest. Would you prefer this?

Attachment: 0001-Give-up-on-Wredundant-decls.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]