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


Groups > comp.lang.c > #107047

Re: Can a variable be both static and extern

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: Can a variable be both static and extern
Date 2017-03-25 10:31 -0700
Organization None to speak of
Message-ID <lna8898dq3.fsf@kst-u.example.com> (permalink)
References (3 earlier) <ob3gvq$1mg$1@dont-email.me> <ob3i26$5fo$2@dont-email.me> <ob3o2p$rak$1@dont-email.me> <b0a05f7d-ba76-3ffd-7b45-0f53b9fd766b@verizon.net> <ob66rd$phv$1@dont-email.me>

Show all headers | View raw


Richard Heathfield <rjh@cpax.org.uk> writes:
[...]
> ISO/IEC 9899 is such an Authority. Even where it lies, it tells the 
> truth, and even where it is mistaken, it is correct until the 
> application of a DR, whereupon it effortlessly changes its mind and is 
> /still/ correct.

And what if the Authority contradicts itself?

For example, the term "expression" is defined both by the grammar:

    expression:
        assignment-expression
        expression , assignment-expression

(with a bunch of rules recursively defining "assignment-expression"
et al) and by the definition in 6.5p1:

    An *expression* is a sequence of operators and operands that
    specifies computation of a value, or that designates an object
    or a function, or that generates side effects, or that performs
    a combination thereof.

The grammar clearly indicates that 42 is an expression.  The English
definition indicates that it is not (it contains no operators and
therefore no operands).  (And no, you can't reasonably invent a null
operator that has 42 as its operand; the normative definition of
"operator" in 6.4.6 doesn't permit that.)

The intent is clear enough (42 is an expression and the definition
in 6.5p1 is flawed), but we can't determine that without applying
common sense rules from outside the standard.

-- 
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"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Can a variable be both static and extern acidlategamer@gmail.com - 2017-03-24 04:23 -0700
  Re: Can a variable be both static and extern Richard Heathfield <rjh@cpax.org.uk> - 2017-03-24 11:40 +0000
    Re: Can a variable be both static and extern acidlategamer@gmail.com - 2017-03-24 04:54 -0700
      Re: Can a variable be both static and extern Richard Heathfield <rjh@cpax.org.uk> - 2017-03-24 12:09 +0000
        Re: Can a variable be both static and extern James Kuyper <jameskuyper@verizon.net> - 2017-03-24 11:45 -0400
          Re: Can a variable be both static and extern raltbos@xs4all.nl (Richard Bos) - 2017-03-25 22:27 +0000
    Re: Can a variable be both static and extern Keith Thompson <kst-u@mib.org> - 2017-03-24 11:35 -0700
  Re: Can a variable be both static and extern Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-24 12:11 +0000
  Re: Can a variable be both static and extern raltbos@xs4all.nl (Richard Bos) - 2017-03-24 12:14 +0000
    Re: Can a variable be both static and extern David Brown <david.brown@hesbynett.no> - 2017-03-24 17:11 +0100
      Re: Can a variable be both static and extern scott@slp53.sl.home (Scott Lurndal) - 2017-03-24 16:22 +0000
        Re: Can a variable be both static and extern David Brown <david.brown@hesbynett.no> - 2017-03-24 17:38 +0100
      Re: Can a variable be both static and extern James Kuyper <jameskuyper@verizon.net> - 2017-03-24 12:23 -0400
        Re: Can a variable be both static and extern David Brown <david.brown@hesbynett.no> - 2017-03-24 17:41 +0100
          Re: Can a variable be both static and extern jameskuyper@verizon.net - 2017-03-24 09:57 -0700
          Re: Can a variable be both static and extern supercat@casperkitty.com - 2017-03-24 10:38 -0700
          Re: Can a variable be both static and extern Richard Heathfield <rjh@cpax.org.uk> - 2017-03-24 18:24 +0000
            Re: Can a variable be both static and extern "James R. Kuyper" <jameskuyper@verizon.net> - 2017-03-25 10:47 -0400
              Re: Can a variable be both static and extern Richard Heathfield <rjh@cpax.org.uk> - 2017-03-25 16:48 +0000
                Re: Can a variable be both static and extern Keith Thompson <kst-u@mib.org> - 2017-03-25 10:31 -0700
                Re: Can a variable be both static and extern Richard Heathfield <rjh@cpax.org.uk> - 2017-03-25 18:23 +0000
                Re: Can a variable be both static and extern supercat@casperkitty.com - 2017-03-25 12:28 -0700
                Re: Can a variable be both static and extern Ike Naar <ike@iceland.freeshell.org> - 2017-03-25 19:50 +0000
                Re: Can a variable be both static and extern supercat@casperkitty.com - 2017-03-25 13:20 -0700
                Re: Can a variable be both static and extern jameskuyper@verizon.net - 2017-03-25 10:44 -0700
                Re: Can a variable be both static and extern supercat@casperkitty.com - 2017-03-25 12:13 -0700

csiph-web