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.