unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master 6cd5678: Clarify compiler-pacifier in frame.c
Date: Mon, 26 Aug 2019 12:47:12 +0300	[thread overview]
Message-ID: <83o90cfecf.fsf@gnu.org> (raw)
In-Reply-To: <87cb5a0c-bdd8-726c-80ed-92e9f3518a58@cs.ucla.edu> (message from Paul Eggert on Mon, 26 Aug 2019 01:15:51 -0700)

> Cc: emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Mon, 26 Aug 2019 01:15:51 -0700
> 
> Eli Zaretskii wrote:
> 
> > The warnings will re-appear if one
> > compiles outside of Git with suitable GCC options, so the solution is
> > incomplete at best.
> 
> We can't (and shouldn't try to) defend against people compiling Emacs with 
> arbitrary-chosen GCC warning options, as there would be far too many false 
> alarms.

It's not about us, it's about GCC's tendency to turn more and more
warnings on by default.

An explicit initialization with a comment explaining it is a small
price to pay for clean compilation in arbitrary environments.

> > An explicit initialization is a tad better, as it doesn't require any
> > tinkering with obscure settings.
> 
> Neither should UNINIT require tinkering, if users employ default configuration 
> settings.

I call GCC_LINT "tinkering".

> Explicit initialization uses plain C rather than the awkward UNINIT macro, and 
> that is a plus for explicit initialization. However, that's a style issue, and 
> for me it's outweighed by the technical advantage of aiding automated debugging 
> tools that I use occasionally.

If this is just your personal stylistic preference, then I'd question
whether we as a project should accept it.  E.g., my stylistic
preference is different; where does that leave us?

> For these tools it is helpful to say that a variable is not
> initialized, because that helps catch use-before-set errors. An
> explicit initialization would cause these use-before-set bugs to go
> uncaught by these debugging tools.

What debugging tools can make a significant difference here, and how
easy/practical is it to use them?  I very much doubt they will catch
every use-before-set bug anyway.



  reply	other threads:[~2019-08-26  9:47 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-24  6:14 [Emacs-diffs] master 6cd5678: Clarify compiler-pacifier in frame.c Eli Zaretskii
2019-08-25  0:52 ` Paul Eggert
2019-08-25  7:13   ` Eli Zaretskii
2019-08-26  6:34     ` Paul Eggert
2019-08-26  7:54       ` Eli Zaretskii
2019-08-26  8:15         ` Paul Eggert
2019-08-26  9:47           ` Eli Zaretskii [this message]
2019-08-26 15:21             ` Óscar Fuentes
2019-08-26 16:13               ` Eli Zaretskii
2019-08-26 18:20                 ` Óscar Fuentes
2019-08-26 18:39                   ` Eli Zaretskii
2019-08-26 19:09                     ` Paul Eggert
2019-08-26 19:15                     ` Óscar Fuentes
2019-08-26 19:33                       ` Eli Zaretskii
2019-08-26 19:49                         ` Óscar Fuentes
2019-08-26 22:33                         ` Paul Eggert
2019-08-27  6:12                           ` Eli Zaretskii
2019-08-27  7:28                             ` Paul Eggert
2019-08-27  8:02                               ` Eli Zaretskii
2019-08-27  9:28                                 ` Paul Eggert
2019-08-27 10:15                                   ` Eli Zaretskii
2019-08-27 12:05                                     ` Paul Eggert
2019-08-27 12:43                                       ` Eli Zaretskii
2019-08-26 18:50             ` Paul Eggert
2019-08-26 18:56               ` Eli Zaretskii
2019-08-26 23:17             ` Richard Stallman

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=83o90cfecf.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    /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).