all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: dmantipov@yandex.ru, emacs-devel@gnu.org
Subject: Re: GCC 4.9.1 suggests -std=c99
Date: Tue, 09 Sep 2014 10:11:39 -0700	[thread overview]
Message-ID: <540F34CB.80202@cs.ucla.edu> (raw)
In-Reply-To: <83tx4gaj41.fsf@gnu.org>

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.



  parent reply	other threads:[~2014-09-09 17:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09 14:30 GCC 4.9.1 suggests -std=c99 Dmitry Antipov
2014-09-09 14:43 ` Eli Zaretskii
2014-09-09 14:58 ` Paul Eggert
2014-09-09 15:06   ` Eli Zaretskii
2014-09-09 15:21     ` Paul Eggert
2014-09-09 15:50       ` Eli Zaretskii
2014-09-09 16:42         ` Dmitry Antipov
2014-09-09 17:11         ` Paul Eggert [this message]
2014-09-09 15:38   ` Dmitry Antipov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=540F34CB.80202@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=dmantipov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.