[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 6cd5678: Clarify compiler-pacifier in frame.c

From: Paul Eggert
Subject: Re: [Emacs-diffs] master 6cd5678: Clarify compiler-pacifier in frame.c
Date: Tue, 27 Aug 2019 00:28:58 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

Eli Zaretskii wrote:
I think you didn't read the code of XParseGeometry (the one that is
executed on MS-Windows) well enough, if you think GCC gave a false

I just now reread that code in current master and still see only a false alarm. If that function returns a mask where (mask & XValue) != 0, then *x must have been set by this statement:

  5298    if (mask & XValue)
  5299      *x = clip_to_bounds (INT_MIN, tempX, INT_MAX);

So, if GCC warns about the use of x in the calling code:

  5342    int geometry = XParseGeometry (SSDATA (string),
  5343                                   &x, &y, &width, &height);
  5344    Lisp_Object result = Qnil;
  5345    if (geometry & XValue)
  5346      {
  5347        Lisp_Object element;
  5349        if (x >= 0 && (geometry & XNegative))

... then GCC is giving a false alarm: x must be initialized in line 5349 if (geometry & XValue) is nonzero in line 5345.

If my reasoning is wrong, can you give the path through the function and its caller where x is used as an uninitialized variable? Because if there is such a path, we shouldn't be marking x with UNINIT; UNINIT is only for pacifying false alarms.

Similarly for y.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]