emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109864: Fix minor problems found


From: Wojciech Meyer
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109864: Fix minor problems found by static checking.
Date: Tue, 04 Sep 2012 19:36:05 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Andreas Schwab <address@hidden>
>> Cc: Eli Zaretskii <address@hidden>,  Paul Eggert <address@hidden>,  
>> address@hidden
>> Date: Tue, 04 Sep 2012 16:33:54 +0200
>>
>> Jason Rumney <address@hidden> writes:
>>
>> > It's not valid C89 is it?
>>
>> Sure it is.  Declarations with initializer are allowed anywhere at the
>> start of the block.
>
> Yes.  But the fragment I cited didn't show the block beginning, which
> is probably why Jason thought it's not valid C89.  Here's more
> context (from another hunk of the same commit):
>
>   --- a/src/xdisp.c   2012-09-02 17:10:35 +0000
>   +++ b/src/xdisp.c   2012-09-03 09:22:43 +0000
>   @@ -13511,9 +13511,10 @@
>        }
>      else if (FRAME_VISIBLE_P (sf) && !FRAME_OBSCURED_P (sf))
>        {
>   -      Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf);
>   +      Lisp_Object mini_window;
>        struct frame *mini_frame;
>
>   +      mini_window = FRAME_MINIBUF_WINDOW (sf);
>        displayed_buffer = XBUFFER (XWINDOW (selected_window)->buffer);
>        /* Use list_of_error, not Qerror, so that
>          we catch only errors and don't run the debugger.  */
>
>

Not initialising the variable makes sense only if we want to conform to
the archaic C standards, or we want later it to be modified, the gcc
compiler will know exactly when the variable has been used or modified
on some code path and will warn you accordingly.

--
Wojciech Meyer
http://danmey.org




reply via email to

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