Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #142991 > unrolled thread

Scopes of identifiers

Started byThiago Adams <thiago.adams@gmail.com>
First post2019-04-10 16:15 -0700
Last post2019-04-11 23:26 -0400
Articles 1 on this page of 41 — 14 participants

Back to article view | Back to comp.lang.c


Contents

  Scopes of identifiers Thiago Adams <thiago.adams@gmail.com> - 2019-04-10 16:15 -0700
    Re: Scopes of identifiers Bart <bc@freeuk.com> - 2019-04-11 00:33 +0100
      Re: Scopes of identifiers Thiago Adams <thiago.adams@gmail.com> - 2019-04-10 16:45 -0700
      Re: Scopes of identifiers Thiago Adams <thiago.adams@gmail.com> - 2019-04-10 18:31 -0700
    Re: Scopes of identifiers Thiago Adams <thiago.adams@gmail.com> - 2019-04-10 16:34 -0700
      Re: Scopes of identifiers Robert Wessel <robertwessel2@yahoo.com> - 2019-04-10 20:50 -0500
      Re: Scopes of identifiers James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-04-10 20:02 -0700
      Re: Scopes of identifiers Keith Thompson <kst-u@mib.org> - 2019-04-10 20:58 -0700
        Re: Scopes of identifiers luser droog <luser.droog@gmail.com> - 2019-04-10 21:48 -0700
        Re: Scopes of identifiers Andrey Tarasevich <andreytarasevich@hotmail.com> - 2019-04-11 11:57 -0700
          Re: Scopes of identifiers scott@slp53.sl.home (Scott Lurndal) - 2019-04-11 19:12 +0000
            Re: Scopes of identifiers Thiago Adams <thiago.adams@gmail.com> - 2019-04-11 12:35 -0700
              Re: Scopes of identifiers Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-04-12 01:11 +0100
                Re: Scopes of identifiers Thiago Adams <thiago.adams@gmail.com> - 2019-04-12 05:29 -0700
                  Re: Scopes of identifiers Thiago Adams <thiago.adams@gmail.com> - 2019-04-12 05:39 -0700
          Re: Scopes of identifiers Keith Thompson <kst-u@mib.org> - 2019-04-11 14:00 -0700
            Re: Scopes of identifiers Nick Bowler <nbowler@draconx.ca> - 2019-04-15 19:48 +0000
      Re: Scopes of identifiers Bart <bc@freeuk.com> - 2019-04-11 10:36 +0100
        Re: Scopes of identifiers Bart <bc@freeuk.com> - 2019-04-11 14:25 +0100
          Re: Scopes of identifiers Keith Thompson <kst-u@mib.org> - 2019-04-11 10:20 -0700
      Re: Scopes of identifiers Thiago Adams <thiago.adams@gmail.com> - 2019-04-11 05:00 -0700
      Re: Scopes of identifiers Thiago Adams <thiago.adams@gmail.com> - 2019-04-11 06:42 -0700
        Re: Scopes of identifiers James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-04-11 08:11 -0700
    Re: Scopes of identifiers BGB <cr88192@gmail.com> - 2019-04-10 22:35 -0500
      Re: Scopes of identifiers Keith Thompson <kst-u@mib.org> - 2019-04-10 22:04 -0700
        Re: Scopes of identifiers BGB <cr88192@gmail.com> - 2019-04-11 05:46 -0500
    Re: Scopes of identifiers John Bode <jfbode1029@gmail.com> - 2019-04-11 12:04 -0700
      Re: Scopes of identifiers James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-04-11 13:18 -0700
      Re: Scopes of identifiers Keith Thompson <kst-u@mib.org> - 2019-04-11 14:31 -0700
    Re: Scopes of identifiers Andrey Tarasevich <andreytarasevich@hotmail.com> - 2019-04-11 12:28 -0700
      Re: Scopes of identifiers Thiago Adams <thiago.adams@gmail.com> - 2019-04-11 12:50 -0700
      Re: Scopes of identifiers James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-04-11 14:20 -0700
        Re: Scopes of identifiers Thiago Adams <thiago.adams@gmail.com> - 2019-04-11 14:43 -0700
        Re: Scopes of identifiers Andrey Tarasevich <andreytarasevich@hotmail.com> - 2019-04-11 15:04 -0700
          Re: Scopes of identifiers Keith Thompson <kst-u@mib.org> - 2019-04-11 17:08 -0700
            Re: Scopes of identifiers Andrey Tarasevich <andreytarasevich@hotmail.com> - 2019-04-11 18:45 -0700
              Re: Scopes of identifiers James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-04-11 23:16 -0400
              Re: Scopes of identifiers Keith Thompson <kst-u@mib.org> - 2019-04-11 20:19 -0700
              Re: Scopes of identifiers Tim Rentsch <tr.17687@z991.linuxsc.com> - 2019-04-12 14:39 -0700
              Re: Scopes of identifiers Ike Naar <ike@sdf.lonestar.org> - 2019-04-13 20:02 +0000
        Re: Scopes of identifiers James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-04-11 23:26 -0400

Page 3 of 3 — ← Prev page 1 2 [3]


#143056

FromJames Kuyper <jameskuyper@alumni.caltech.edu>
Date2019-04-11 23:26 -0400
Message-ID<q8p0h0$mf3$1@dont-email.me>
In reply to#143037
On 4/11/19 10:23 PM, Stefan Ram wrote:
> James Kuyper <jameskuyper@alumni.caltech.edu> writes:
>> "Two identifiers have the _same scope_ if and only if their scopes
>> terminate at the same point." (6.2.1p6). The phrase "same scope" is
> 
>   What I find confusing is that in the block
> 
> { int x; int y; }
> 
>   , the scopes of "x" and of "y" begin at the first and
>   the second semicolon, respectively, according to:
> 
> |Any other identifier has scope that begins just after the
> |completion of its declarator.
> n2310 6.2.1p7
> 
>   . And I assume that both scopes end just in front of the
>   closing curly brace.
> 
> { int x; int y; }
>        xxxxxxxxx
>               yy
> 
>   While the two scopes overlap at the end, they are obviously
>   different, not the same - because they begin at different
>   positions.
> 
>   Now, 6.2.1p6 wants to tell me, "x" and "y" have the
>   "same scope"?
> 
>   To me, this conflicts with the normal English meaning of
>   "same", which in the case of an interval means "starting
>   /and/ ending at the same position", not just "ending at the
>   same position".

Yes, that is precisely the point of giving a specialized definition for
the term: it's meaning is NOT the same as the ordinary english meaning
of the phrase. A "null pointer constant" need not have pointer type. Not
all constant expressions of integer type are "integer constant
expressions". An implementation is free to define what the behavior of a
construct with "undefined behavior" will be if translated by that
implementation.
The standard provides it's own definition for those terms precisely
BECAUSE the ordinary english meaning that would normally apply to them
is not the meaning that the standard is using.

Why is the standard written this way? The answer is simple: take the
definition of any term that is provided by the standard, and try to come
up with a different ordinary English term, no longer than the one that
the standard chose, that has exactly the meaning provided by that
definition. In general, the shortest such phrase isn't much shorter than
the definition itself. Can you imagine what the standard would look like
if every occurrence of a term defined by the standard were replaced with
that term's definition?

[toc] | [prev] | [standalone]


Page 3 of 3 — ← Prev page 1 2 [3]

Back to top | Article view | comp.lang.c


csiph-web