[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#23640: 25.1.50; Getting rid of compiler warnings
From: |
Paul Eggert |
Subject: |
bug#23640: 25.1.50; Getting rid of compiler warnings |
Date: |
Wed, 1 Jun 2016 01:55:13 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 |
Surely this makes the code easier to understand, since "int i = 0;"
immediately shows that the variable is always initialised
That is a superficial form of understanding, one that could be satisfied by
initializing all variables whether they need it or not. If instead we make it
clear that the initialization is present only to work around a GCC deficiency,
the reader will get a less-shallow understanding.
any codebase has to deal with the world as it is,
not the ideal in one of the applicable standards.
Yes, and Emacs was changed to work around the Cygnus and FreeBSD glitches; see:
http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=cb379cbb7fc617f897e7dbc3ce45bf99ea3d1f87
> the performance cost of this is likely to be unmeasurably small
Yes, it's primarily about making the code clearer, not performance.
GCC is gradually getting smarter in this area, and eventually I hope we can
remove more IF_LINT instances. I removed several instances recently; see:
http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=237244bbd5ce753bcdf79634561de515bd76c687
- bug#23640: 25.1.50; Getting rid of compiler warnings, (continued)
- bug#23640: 25.1.50; Getting rid of compiler warnings, Richard Stallman, 2016/06/01
- bug#23640: 25.1.50; Getting rid of compiler warnings, Paul Eggert, 2016/06/01
- bug#23640: 25.1.50; Getting rid of compiler warnings, Andy Moreton, 2016/06/02
- bug#23640: 25.1.50; Getting rid of compiler warnings, Richard Stallman, 2016/06/02
- bug#23640: 25.1.50; Getting rid of compiler warnings, Paul Eggert, 2016/06/06
- bug#23640: 25.1.50; Getting rid of compiler warnings, Richard Stallman, 2016/06/07
- bug#23640: 25.1.50; Getting rid of compiler warnings, Paul Eggert, 2016/06/07
- bug#23640: 25.1.50; Getting rid of compiler warnings, Richard Stallman, 2016/06/08
- bug#23640: 25.1.50; Getting rid of compiler warnings, Paul Eggert, 2016/06/08
- bug#23640: 25.1.50; Getting rid of compiler warnings, Richard Stallman, 2016/06/08
bug#23640: 25.1.50; Getting rid of compiler warnings,
Paul Eggert <=