emacs-devel
[Top][All Lists]
Advanced

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

Re: GCC 7 warnings


From: Paul Eggert
Subject: Re: GCC 7 warnings
Date: Sat, 9 Sep 2017 11:27:40 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

Eli Zaretskii wrote:
Paul, why do we use level 5 here, instead of using level 3, the
default?  Level 3 supports the /* FALLTHROUGH */ and similar comments
that indicate a fall-through in a more portable way.

Those comments have problems of their own, as they don't play well with macros and with non-GCC auditing tools that look at preprocessor output. So in other GNU projects we use level 5. It's easy enough to use it portably, and we've done that elsewhere in Emacs with the FALLTHROUGH macro. I just never noticed tparam.c since I never compiled it. I fixed it just now.

Many of the problems you ran into are because of my 2016-05-30 patch "Omit IF_LINT code that no longer seems needed" that simplified the code by assuming a recent-enough GCC for --enable-gcc-warnings.

There is a tradeoff for --enable-gcc-warnings. If we try to support ancient GCC compilers, we'll have to complicate the code and consume scarce maintenance resources. If we support only the latest GCC, developers using slightly-older GCCs will get some annoying warnings when they use --enable-gcc-warnings. I prefer to push the bleeding edge here, and ask developers who use --enable-gcc-warnings to at most (say) a year-old GCC version, as this saves some work for the rest of us. Of course we can't expect everybody to immediately sync to the latest GCC when released, but on the other hand there is a cost to supporting too-old GCCs, a cost I'd rather not pay (since I bear a good deal of it...).

By the way, I find the UNINIT macro to be more readable than supplying nonce expressions, as UNINIT clearly indicates to the reader that the variable is intended to be uninitialized. So I used that as part of my fixups. The pre-2016-05-30 version of the code was using UNINIT anyway.



reply via email to

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