GNU bug report logs -
#23640
25.1.50; Getting rid of compiler warnings
Previous Next
Reported by: Ken Brown <kbrown <at> cornell.edu>
Date: Sat, 28 May 2016 18:41:02 UTC
Severity: normal
Found in version 25.1.50
Done: Ken Brown <kbrown <at> cornell.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> 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
This bug report was last modified 8 years and 349 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.