emacs-devel
[Top][All Lists]
Advanced

[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: Thu, 15 Jan 2015 20:50:11 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

Dmitry Antipov wrote:
> Why not use #pragma in the way similar to bytecode.c?

I'd rather not head down that direction, as it is ugly in a different way: seven lines' worth of preprocessor directives to silence one bogus diagnostic?!

> '--enable-gcc-warnings --with-x-toolkit=no' build should have the
> Fnext_read_file_uses_dialog_p-like issue with Fx_uses_old_gtk_dialog.
> But I don't see it, and don't understand why

I don't know why either. Apparently GCC does not do a perfect job of suggesting the attribute.

Stefan Monnier wrote:

Easy, then: either you live with this warning, or you don't
enable -Wsuggest-attribute=const.

Let's do the latter. A couple of things. First, I checked, and the attribute doesn't significantly help Emacs's performance, so it appears to be more trouble than it's worth for us. Second, I audited the code and found five instances where we blindly followed GCC's advice and added ATTRIBUTE_CONST even though this was incorrect on some platforms; these mistakes suggest that we need to be more skeptical of GCC's diagnostics in this area on the rare occasions when we do use -Wsuggest-attribute=const.

I installed the attached patch to try to fix all this.

Attachment: 0001-Give-up-on-Wsuggest-attribute-const.patch
Description: Text Data


reply via email to

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