all messages for Emacs-related lists mirrored at yhetil.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: Tue, 27 Aug 2019 13:15:12 +0300	[thread overview]
Message-ID: <83ftlmewy7.fsf@gnu.org> (raw)
In-Reply-To: <9d22dab3-e353-2401-0de3-6fc149e9e09f@cs.ucla.edu> (message from Paul Eggert on Tue, 27 Aug 2019 02:28:42 -0700)

> Cc: emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Tue, 27 Aug 2019 02:28:42 -0700
> 
> There are two reasons that omitting UNINIT causes GCC to warn about 
> Fx_parse_geometry but not image_create_bitmap_from_file. First, under MS-Windows 
> GCC has access to the source code of the initialization function XParseGeometry 
> that Fx_parse_geometry calls, whereas under X Windows GCC lacks access to the 
> source code of the initialization function XReadBitmapFile that 
> image_create_bitmap_from_file calls (I am assuming typical builds without fancy 
> link-time optimization). Second, GCC does not fully grok the source code of 
> MS-Windows XParseGeometry; GCC gets lost and thinks that there's a path through 
> Fx_parse_geometry + XParseGeometry that will use Fx_parse_geometry's x without 
> initializing it, even though there is no such path.

Do you have a guess why GCC might get lost in that code?

> > And how should GCC know that?
> 
> GCC could use the same sort of reasoning I used.

Which reasoning is that?  You haven't presented your reasoning for
XParseGeometry, AFAICT.  You presented reasoning for some other code,
which you consider similar.

> And perhaps some future version of GCC will do that. But in the
> meantime GCC gives a false alarm, so UNINIT is warranted here.
> 
> UNINIT is precisely for this sort of situation: the programmer knows that a 
> variable need not be initialized, but GCC falsely warns about the lack of 
> initialization.

No, UNINIT is for you to be able to use your tools of choice, and
perhaps also to cater to your personal stylistic preferences.  I
consider an initialization with a comment explaining why to be a
better alternative, whether the warning is real or a false alarm.



  reply	other threads:[~2019-08-27 10:15 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
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 [this message]
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

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

  git send-email \
    --in-reply-to=83ftlmewy7.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.