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: Jan Djärv
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109864: Fix minor problems found by static checking.
Date: Tue, 4 Sep 2012 07:29:00 +0200

Hello.

4 sep 2012 kl. 05:41 skrev Stefan Monnier <address@hidden>:

>> GCC false alarms aside, are there any reasons to prefer separate
>> declaration and initialization?
> 
> There are software-engineering reasons to prefer the "initialize as part
> of declare" so it's trivially obvious that the variable can't
> be uninitialized.  So in general, we'd first want to investigate other
> solutions if such an "init within declare" causes problems.

Another good thing is that init within declare variables can be declared const 
if they are not changed later.
This may not help compilers much nowdays, but it helps when reading code.

Emacs does not use const much. Is there a policy for its usage?

    Jan D.


reply via email to

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