comp.lang.ada
 help / color / mirror / Atom feed
From: "David Thompson" <david.thompson1@worldnet.att.net>
Subject: Re: Localized Variable Declaration
Date: Tue, 11 Jun 2002 07:16:31 GMT
Date: 2002-06-11T07:16:31+00:00	[thread overview]
Message-ID: <jthN8.35340$UT.2424365@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: u66133var.fsf@gsfc.nasa.gov

Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov> wrote :
> "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org> writes:
>
> > I disagree with the style issue, but the last time I checked, I could
> > declare variables in C in the middle of the code. They can even be scoped
> > with {}, IIRC. Maybe that's not "standard" C? It seems to go past the gcc
> > compiler I'm using.
>
C has always (or at least since before K&R1) allowed declarations
at the beginning of any compound statement (delimited by braces),
not just the compound statement which is the body of a function.
This distinction was not kept clear in most of the thread.

> To get the Gnu compiler to enforce the ANSI C 89
> standard, use the switches -ansi -pedantic.
>
> Anyone know when Gnu C will support C99? ...

Yep.  Note that C99, like C++ and GNU-C, allows declarations
"anywhere" a statement is valid (except immediately after a label).
(Like PL/1.  <G>)  And C99 like C++ has a form of the for statement
that locally declares the loop variable.

Hmm, anyone recall which way(s) algol went on this?
IIRC LISP allows declarations anywhere as well as nowhere.
(That is, they are optional, but if used can be anywhere.)

--
- David.Thompson 1 now at worldnet.att.net








  parent reply	other threads:[~2002-06-11  7:16 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-31 13:24 Localized Variable Declaration David Rasmussen
2002-05-31 13:32 ` martin.m.dowie
2002-05-31 13:38   ` David Rasmussen
2002-05-31 13:50     ` martin.m.dowie
2002-05-31 14:48       ` David Rasmussen
2002-05-31 15:26         ` martin.m.dowie
2002-05-31 15:45           ` David Rasmussen
2002-05-31 18:30             ` Jeffrey Carter
2002-06-02  2:21             ` steve_H
2002-06-02  9:59               ` David Rasmussen
2002-06-02 15:06                 ` Robert Dewar
2002-06-02 15:27                   ` David Rasmussen
2002-06-02 23:25                     ` Hyman Rosen
2002-06-02 23:28                       ` David Rasmussen
2002-06-02 23:52                     ` martin.m.dowie
2002-06-02 23:58                       ` David Rasmussen
2002-06-03 11:22                         ` martin.m.dowie
2002-05-31 15:51           ` Mark Johnson
2002-05-31 17:47             ` martin.m.dowie
2002-05-31 21:53           ` tmoran
2002-06-02 15:10             ` Robert Dewar
2002-06-02 15:28               ` Vinzent Hoefler
2002-06-02 18:04               ` tmoran
2002-06-07  3:32               ` Richard Riehle
2002-05-31 15:59         ` Darren New
2002-06-02 15:20           ` Robert Dewar
2002-06-03  5:29             ` Michael Bode
2002-06-03  6:17               ` Preben Randhol
2002-06-04 10:26                 ` Simon Wright
2002-06-03 13:59               ` Marin David Condic
2002-06-05  8:36                 ` Dmitry A.Kazakov
2002-06-03 17:29               ` Pascal Obry
2002-06-16 23:34               ` Robert A Duff
2002-06-04 12:13             ` Georg Bauhaus
2002-05-31 19:00         ` Mike Silva
2002-06-01  0:58         ` Robert Dewar
2002-05-31 18:04       ` Larry Kilgallen
2002-05-31 15:06     ` Marin David Condic
2002-06-01 14:53       ` Stephen Leake
2002-06-02 21:18         ` Florian Weimer
2002-06-11  7:16         ` David Thompson [this message]
2002-05-31 18:30     ` Stephen Leake
2002-06-02  1:52 ` Stefan Skoglund
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox