Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #75880 > unrolled thread
| Started by | Jon Rossen <jonr17@comcast.net> |
|---|---|
| First post | 2015-11-12 13:32 -0800 |
| Last post | 2015-11-15 21:17 -0800 |
| Articles | 2 on this page of 22 — 7 participants |
Back to article view | Back to comp.lang.c
A question on variable scope, coming from a relative beginner Jon Rossen <jonr17@comcast.net> - 2015-11-12 13:32 -0800
Re: A question on variable scope, coming from a relative beginner John Gordon <gordon@panix.com> - 2015-11-12 21:57 +0000
Re: A question on variable scope, coming from a relative beginner Jon Rossen <jonr17@comcast.net> - 2015-11-12 16:06 -0800
Re: A question on variable scope, coming from a relative beginner James Kuyper <jameskuyper@verizon.net> - 2015-11-12 19:33 -0500
Re: A question on variable scope, coming from a relative beginner Jon Rossen <jonr17@comcast.net> - 2015-11-12 20:22 -0800
Re: A question on variable scope, coming from a relative beginner James Kuyper <jameskuyper@verizon.net> - 2015-11-13 08:08 -0500
Re: A question on variable scope, coming from a relative beginner Richard Heathfield <rjh@cpax.org.uk> - 2015-11-12 21:57 +0000
Re: A question on variable scope, coming from a relative beginner Jon Rossen <jonr17@comcast.net> - 2015-11-12 18:47 -0800
Re: A question on variable scope, coming from a relative beginner James Kuyper <jameskuyper@verizon.net> - 2015-11-12 22:19 -0500
Re: A question on variable scope, coming from a relative beginner Jon Rossen <jonr17@comcast.net> - 2015-11-12 22:05 -0800
Re: A question on variable scope, coming from a relative beginner Richard Heathfield <rjh@cpax.org.uk> - 2015-11-13 07:10 +0000
Re: A question on variable scope, coming from a relative beginner James Kuyper <jameskuyper@verizon.net> - 2015-11-13 08:33 -0500
Re: A question on variable scope, coming from a relative beginner Tim Rentsch <txr@alumni.caltech.edu> - 2015-11-13 12:24 -0800
Re: A question on variable scope, coming from a relative beginner Keith Thompson <kst-u@mib.org> - 2015-11-14 11:58 -0800
Re: A question on variable scope, coming from a relative beginner James Kuyper <jameskuyper@verizon.net> - 2015-11-14 15:27 -0500
Re: A question on variable scope, coming from a relative beginner Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-11-12 14:00 -0800
Re: A question on variable scope, coming from a relative beginner Richard Heathfield <rjh@cpax.org.uk> - 2015-11-12 23:55 +0000
Re: A question on variable scope, coming from a relative beginner Keith Thompson <kst-u@mib.org> - 2015-11-12 17:11 -0800
Re: A question on variable scope, coming from a relative beginner Jon Rossen <jonr17@comcast.net> - 2015-11-12 20:39 -0800
Re: A question on variable scope, coming from a relative beginner Jon Rossen <jonr17@comcast.net> - 2015-11-12 20:38 -0800
Re: A question on variable scope, coming from a relative beginner Keith Thompson <kst-u@mib.org> - 2015-11-12 22:13 -0800
Re: A question on variable scope, coming from a relative beginner Jon Rossen <jonr17@comcast.net> - 2015-11-15 21:17 -0800
Page 2 of 2 — ← Prev page 1 [2]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2015-11-12 22:13 -0800 |
| Message-ID | <lny4e2o28v.fsf@kst-u.example.com> |
| In reply to | #75922 |
Jon Rossen <jonr17@comcast.net> writes:
> On 11/12/2015 4:25 PM, Stefan Ram wrote:
>> Jon Rossen <jonr17@comcast.net> writes:
>>> extern int x; // This entire statement is not necessary to
>>
>> It's not a statement, it's a declaration (a block-item).
>>
>>> omit the 'extern int x' statement completely,
>>
>> »extern int ׫ is not a statement.
>>
>
> Couldn't it be considered both? In other words can't the term
> 'statement' be considered a superset that includes smaller subsets such
> as declarations?
It *could* be, but it isn't.
The C standard defines what a "declaration" is, and what a "statement"
is, and they're disjoint sets. There's no fundamental reason for that,
it's just the way the standard defines the terms.
(In C++, a declaration is considered a kind of statement. That may have
been influenced by the fact that C++ permitted mixed declarations and
statements before C did; C added that feature in C99, but didn't change
the meanings of "statement" and "declaration".)
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
[toc] | [prev] | [next] | [standalone]
| From | Jon Rossen <jonr17@comcast.net> |
|---|---|
| Date | 2015-11-15 21:17 -0800 |
| Message-ID | <n2bot2$20q$1@news.albasani.net> |
| In reply to | #75925 |
On 11/12/2015 10:13 PM, Keith Thompson wrote: > Jon Rossen <jonr17@comcast.net> writes: >> On 11/12/2015 4:25 PM, Stefan Ram wrote: >>> Jon Rossen <jonr17@comcast.net> writes: >>>> extern int x; // This entire statement is not necessary to >>> >>> It's not a statement, it's a declaration (a block-item). >>> >>>> omit the 'extern int x' statement completely, >>> >>> »extern int ׫ is not a statement. >>> >> >> Couldn't it be considered both? In other words can't the term >> 'statement' be considered a superset that includes smaller subsets such >> as declarations? > > It *could* be, but it isn't. > > The C standard defines what a "declaration" is, and what a "statement" > is, and they're disjoint sets. There's no fundamental reason for that, > it's just the way the standard defines the terms. > > (In C++, a declaration is considered a kind of statement. That may have > been influenced by the fact that C++ permitted mixed declarations and > statements before C did; C added that feature in C99, but didn't change > the meanings of "statement" and "declaration".) > Keith, much thanks for the further elaboration and the brief historical perspective. -jonR
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | comp.lang.c
csiph-web