Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: ridiculous warning or not? |
| Date | 2012-12-20 16:57 -0800 |
| Organization | None to speak of |
| Message-ID | <ln623wql0y.fsf@nuthaus.mib.org> (permalink) |
| References | (6 earlier) <kfny5kkwsqm.fsf@x-alumni2.alumni.caltech.edu> <lnk3w4jred.fsf@nuthaus.mib.org> <kfnvcc0fglj.fsf@x-alumni2.alumni.caltech.edu> <lnpq28grlu.fsf@nuthaus.mib.org> <kfnwqwceftm.fsf@x-alumni2.alumni.caltech.edu> |
Tim Rentsch <txr@alumni.caltech.edu> writes:
> Keith Thompson <kst-u@mib.org> writes:
>> Tim Rentsch <txr@alumni.caltech.edu> writes:
>>> Keith Thompson <kst-u@mib.org> writes:
>>>> Tim Rentsch <txr@alumni.caltech.edu> writes:
>>>> [...]
>>>>> I understand that you would like how the Standard is read to be
>>>>> the same in comp.lang.c and comp.std.c. For now, though, let me
>>>>> suggest that conversations about that are better in comp.std.c,
>>>>> and for purposes of comp.lang.c it's better to read the Standard
>>>>> how you think the committee reads it or expects it will be read.
>>>>> Does that all make sense?
>>>>
>>>> Yes, more or less. In this particular case, though, there's a rule
>>>> that's only stated in an example, and that IMHO is not supported
>>>> by the normative text (though it could be with a small tweak).
>>>> Furthermore, it's a rule that doesn't make a whole lot of sense
>>>> to me. This raised, at least for me, a serious question about what
>>>>
>>>> int i[];
>>>>
>>>> as an external definition with no later completion of the type
>>>> actually *means*, and whether it's even valid. It raises issues both
>>>> about the text of the standard (clearly appropriate for comp.std.c),
>>>> and about the semantics of the language defined by the standard
>>>> (clearly appropriate for comp.lang.c).
>>>
>>> Oh, that may be a difference between us. As far as I'm concerned,
>>> what happens in this case is both defined enough and clear enough
>>> (for purposes of comp.lang.c) so that there's no question about
>>> what's supposed to happen. I agree that the Standard could do a
>>> better job of expressing this, but not so much that anyone who
>>> wants to understand what semantics are dictated is likely to be
>>> misled. Let me ask it as a question: how likely is it (in your
>>> opinion) that someone reading the Standard will reach a wrong
>>> conclusion about what the behavior should be in such cases?
>>
>> Very likely, IMHO.
>>
>> The wording in question is N1570 6.9.2p5, a non-normative example:
>>
>> EXAMPLE 2 If at the end of the translation unit containing
>>
>> int i[];
>>
>> the array i still has incomplete type, the implicit initializer
>> causes it to have one element, which is set to zero on program
>> startup.
>>
>> In the absence of that example, it would never have occurred to me that
>> the array i has one element. [snip elaboration]
>
> Yes but the example is there! That's really the point of
> what I'm saying: given that the example _is_ there, I think
> it's highly unlikely that anyone will be misled about what
> the Standard expects should happen. Right? Or do you think
> they won't notice or won't understand the example?
Sure, the example is clear enough.
I just don't think that the assertion in the example follows,
or *should* follow, from the normative text. And I wouldn't want
to rely on what it says, both because if I want a 1-element array
it's easy enough to replace "[]" by "[1]", and because I wouldn't be
astonished if some compiler, following just the normative wording,
didn't implement it that way.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Will write code for food.
"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
ridiculous warning or not? kerravon <kerravon@w3.to> - 2012-08-20 02:41 -0700
Re: ridiculous warning or not? Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-08-20 07:55 -0400
Re: ridiculous warning or not? army1987 <army1987@ask-for-it.invalid> - 2012-08-20 19:11 +0000
Re: ridiculous warning or not? Kenneth Brody <kenbrody@spamcop.net> - 2012-08-20 16:09 -0400
Re: ridiculous warning or not? Tim Rentsch <txr@alumni.caltech.edu> - 2012-09-07 07:29 -0700
Re: ridiculous warning or not? Andrew Cooper <amc96@cam.ac.uk> - 2012-08-21 00:36 +0100
Re: ridiculous warning or not? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-08-21 01:41 +0100
Re: ridiculous warning or not? Keith Thompson <kst-u@mib.org> - 2012-08-20 18:59 -0700
Re: ridiculous warning or not? Tim Rentsch <txr@alumni.caltech.edu> - 2012-09-07 08:03 -0700
Re: ridiculous warning or not? Keith Thompson <kst-u@mib.org> - 2012-09-07 14:37 -0700
Re: ridiculous warning or not? Tim Rentsch <txr@alumni.caltech.edu> - 2012-09-07 19:17 -0700
Re: ridiculous warning or not? Keith Thompson <kst-u@mib.org> - 2012-09-07 19:56 -0700
Re: ridiculous warning or not? Tim Rentsch <txr@alumni.caltech.edu> - 2012-09-08 06:30 -0700
Re: ridiculous warning or not? Tim Rentsch <txr@alumni.caltech.edu> - 2012-09-07 07:57 -0700
Re: ridiculous warning or not? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-09-08 00:25 +0100
Re: ridiculous warning or not? Tim Rentsch <txr@alumni.caltech.edu> - 2012-09-07 18:58 -0700
Re: ridiculous warning or not? Keith Thompson <kst-u@mib.org> - 2012-09-07 19:26 -0700
Re: ridiculous warning or not? Tim Rentsch <txr@alumni.caltech.edu> - 2012-09-08 06:26 -0700
Re: ridiculous warning or not? Keith Thompson <kst-u@mib.org> - 2012-09-08 11:33 -0700
Re: ridiculous warning or not? Tim Rentsch <txr@alumni.caltech.edu> - 2012-12-17 14:39 -0800
Re: ridiculous warning or not? Keith Thompson <kst-u@mib.org> - 2012-12-17 15:56 -0800
Re: ridiculous warning or not? Tim Rentsch <txr@alumni.caltech.edu> - 2012-12-20 10:31 -0800
Re: ridiculous warning or not? Keith Thompson <kst-u@mib.org> - 2012-12-20 16:57 -0800
Re: ridiculous warning or not? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-12-21 03:11 +0000
Re: ridiculous warning or not? Tim Rentsch <txr@alumni.caltech.edu> - 2012-12-21 09:06 -0800
Re: ridiculous warning or not? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-09-08 03:42 +0100
Re: ridiculous warning or not? Tim Rentsch <txr@alumni.caltech.edu> - 2012-09-08 06:01 -0700
Re: ridiculous warning or not? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-09-08 14:45 +0100
Re: ridiculous warning or not? Keith Thompson <kst-u@mib.org> - 2012-09-08 11:28 -0700
Re: ridiculous warning or not? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-09-08 22:53 +0100
Re: ridiculous warning or not? kerravon <kerravon@w3.to> - 2012-08-21 03:25 -0700
Re: ridiculous warning or not? 88888 Dihedral <dihedral88888@googlemail.com> - 2012-08-21 11:20 -0700
Re: ridiculous warning or not? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-08-21 21:07 +0100
Re: ridiculous warning or not? 88888 Dihedral <dihedral88888@googlemail.com> - 2012-08-21 14:39 -0700
Re: ridiculous warning or not? Ike Naar <ike@iceland.freeshell.org> - 2012-08-21 22:09 +0000
Re: ridiculous warning or not? 88888 Dihedral <dihedral88888@googlemail.com> - 2012-08-21 15:13 -0700
Re: ridiculous warning or not? Fred K <fred.l.kleinschmidt@gmail.com> - 2012-08-22 07:17 -0700
csiph-web