emacs-devel
[Top][All Lists]
Advanced

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

Re: GCC 4.9.1 suggests -std=c99


From: Paul Eggert
Subject: Re: GCC 4.9.1 suggests -std=c99
Date: Tue, 09 Sep 2014 10:11:39 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0

Eli Zaretskii wrote:
we should have discussed whether to use these C99 features
before actually starting using them.

We discussed them in Bug#17487. As I mentioned, Emacs developers routinely made changes that used these features, I was occasionally auditing the code and removing their use for no practical reason (only because of standards-conformance issues), and I got tired of this pointless task.

My guess is that when Michael Albinus introduced the 'for (int i = 1; ...' loop in trunk bzr 117771, he wasn't consciously thinking "Oh boy! I get to use C99 now! I will now change Emacs's style!" Most likely he was just using a common and natural idiom that worked for him, and didn't notice that it wouldn't port to C89 and was therefore contrary to Emacs's old style rules.

Emacs definitely has certain
coding style, which doesn't include these.

The part of Emacs's style that disallowed these C99 features was there primarily because of C89's restrictions. It's often not the best style and we should not insist on it.

I agree with Dmitry that we should not insist on a declaration as the first clause of every for loop, but there doesn't seem to be a good reason to prohibit a declaration there, whereas there is a good reason (more-accurate scoping) to allow it.



reply via email to

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