bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#35062: [PATCH v3 2/3] constify a bit of xterm.c


From: Eli Zaretskii
Subject: bug#35062: [PATCH v3 2/3] constify a bit of xterm.c
Date: Sat, 13 Apr 2019 14:36:38 +0300

> Date: Sat, 13 Apr 2019 14:30:46 +0300
> From: Konstantin Kharlamov <hi-angel@yandex.ru>
> Cc: Paul Eggert <eggert@cs.ucla.edu>, 35062@debbugs.gnu.org
> 
> I'd like to take this as an opportunity to ask a question: I see Emacs 
> C code is using the old style where variables (mostly) are declared at 
> the beginning of a function. Is it just a legacy from C89 days (I hope 
> so), or is it a mandatory style?

It's legacy.  Nowadays we allow declarations near the first usage, per
C99.  But again, we only make changes in the order as part of other
code changes, not just by themselves.

> I'm asking because if I gonna work on the code, I'd for sure like to 
> encapsulate variables as much as possible, which means I'd rather 
> declare them on the first use (as a bonus, this often may allow to 
> constify the variable too).

That's okay.  We require C99 these days.





reply via email to

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