unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Andy Moreton <andrewjmoreton@gmail.com>
Cc: 23640@debbugs.gnu.org
Subject: bug#23640: 25.1.50; Getting rid of compiler warnings
Date: Wed, 1 Jun 2016 01:55:13 -0700	[thread overview]
Message-ID: <574EA2F1.3070100@cs.ucla.edu> (raw)
In-Reply-To: <ff882ff4-e092-afe2-3a71-e22bce3c114d@cornell.edu>

> 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





      parent reply	other threads:[~2016-06-01  8:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-28 18:40 bug#23640: 25.1.50; Getting rid of compiler warnings Ken Brown
2016-05-28 18:57 ` Eli Zaretskii
2016-05-28 21:47   ` Ken Brown
2016-05-29 22:43     ` Ken Brown
2016-05-30 11:39       ` Ken Brown
2016-05-30 14:41         ` Ken Brown
2016-05-30 16:20           ` Ken Brown
2016-05-30 23:29           ` Paul Eggert
2016-05-31  0:11             ` Ken Brown
2016-05-31  8:03             ` Andy Moreton
2016-05-31 22:22               ` Richard Stallman
2016-05-31  0:15           ` Paul Eggert
2016-06-01  8:35 ` Paul Eggert
2016-06-01 20:37   ` Richard Stallman
2016-06-01 21:10     ` Paul Eggert
2016-06-02 12:05       ` Andy Moreton
2016-06-03  3:35       ` Richard Stallman
2016-06-06 14:45         ` Paul Eggert
2016-06-07  6:19           ` Richard Stallman
2016-06-07  7:15             ` Paul Eggert
2016-06-08  4:00               ` Richard Stallman
2016-06-08  7:18                 ` Paul Eggert
2016-06-08 17:06                   ` Richard Stallman
2016-06-01  8:55 ` Paul Eggert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=574EA2F1.3070100@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=23640@debbugs.gnu.org \
    --cc=andrewjmoreton@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).