Deutsch   English   Français   Italiano  
<vitkka$1ut3j$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Opus <ifonly@youknew.org>
Newsgroups: comp.lang.c
Subject: Re: question about linker
Date: Fri, 6 Dec 2024 02:39:22 +0100
Organization: A noiseless patient Spider
Lines: 71
Message-ID: <vitkka$1ut3j$1@dont-email.me>
References: <vi54e9$3ie0o$1@dont-email.me> <vi6sb1$148h7$1@paganini.bofh.team>
 <vi6uaj$3ve13$2@dont-email.me> <87plmfu2ub.fsf@nosuchdomain.example.com>
 <vi9jk4$gse4$1@dont-email.me> <vi9kng$gn4c$1@dont-email.me>
 <87frnbt9jn.fsf@nosuchdomain.example.com> <viaqh0$nm7q$1@dont-email.me>
 <877c8nt255.fsf@nosuchdomain.example.com> <viasv4$nm7q$2@dont-email.me>
 <vibr1l$vvjf$1@dont-email.me> <vic73f$1205f$1@dont-email.me>
 <20241129142810.00007920@yahoo.com> <vicfra$13nl4$1@dont-email.me>
 <20241129161517.000010b8@yahoo.com> <vicque$15ium$2@dont-email.me>
 <vid110$16hte$1@dont-email.me> <vifcll$1q9rj$1@dont-email.me>
 <vifiib$1s07p$1@dont-email.me> <87ldwx10gv.fsf@bsb.me.uk>
 <vimtt4$27vv$1@dont-email.me> <vin7r2$49d1$2@dont-email.me>
 <vinalt$5qoh$1@dont-email.me> <vipgns$rjqn$1@dont-email.me>
 <viqbl8$12mum$1@dont-email.me> <viqfuh$131h8$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 06 Dec 2024 02:39:23 +0100 (CET)
Injection-Info: dont-email.me; posting-host="eccd6f373c1a81111cdc14f84f85d400";
	logging-data="2061427"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19WnZrkcw+ZdoxNguq4io2+"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:JxSJfTQbGDMYrwJLrKdMrsVyW2M=
Content-Language: en-US
In-Reply-To: <viqfuh$131h8$2@dont-email.me>
Bytes: 4413

On 04/12/2024 22:01, Bart wrote:
> On 04/12/2024 19:47, Janis Papanagnou wrote:
>> On 04.12.2024 13:08, David Brown wrote:
> 
>>> Sure.  And it is certainly /possible/ to know all the small details of C
>>> without ever reading the standards.  But it's quite unlikely.
>>
>> The question is (IMO) not so much to know "all" and even "all small"
>> details. Even in a language like "C" (that I'd consider to be fairly
>> incoherent if compared to other languages' design) you can get all
>> "important" language properties (including details) from textbooks.
>>
>> If cases where that is different, the standards documents - which
>> have their very own special way of being written - would be even
>> less comprehensibly as they (inherently) already are. - That said
>> from a programmer's POV (not from the language implementors').
>>
>> I look into language standards only if I want to confirm/falsify
>> an implementation; in this case I'm taking the role of a language
>> implementor (not a programmer). Personally I do that anyway only
>> rarely, for specific languages only, and just out of academical
>> interest.
>>
>>> [...]
>>> Bart is an expert at thinking up things in C that confuse him.
>>
>> Well, that's an own topic. - Where I was really astonished was the
>> statement of being confused about the braces/semicolons, which is
>> so fundamental (and primitive) but technically just a detail that
>> I'd thought it should be clear
> 
> 
> OK, if it's so simple, explain it to me.
> 
> Apparently the first line here needs a semicolon after }, the second 
> doesn't:
> 
>    int X[1] = {0};
>    void Y() {}
> 
> Similarly here:
> 
>    if (x) y;
>    if (x) {}
> 
> Why?
> 
> "Because that's what the grammar says" isn't a valid answer.
> 
> The C language is one of the most quirky ones around full of apparently 
> ridiculous things. Why shouldn't you be able to write this for example:
> 
>     {
>     ....
>     L:
>     }
> 
> This stupid rule means that EVERY label in my generated code needs to be 
> written as L:; instead of just L:
> 
> Please don't say the label is only defined to be a prefix to another 
> statement. I asking why it was done like that.

- It's reasonable not to require a semicolon (which is a statement 
termination) to terminate a statement block, which is terminated by the 
closing brace. A semicolon would be redundant.

- For labels, I agree, but the deeper issue is not that; it's to have 
goto's when better constructs would be the fix.