| Deutsch English Français Italiano |
|
<87h67hzhm9.fsf@nosuchdomain.example.com> 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: Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: question about linker
Date: Thu, 05 Dec 2024 18:10:22 -0800
Organization: None to speak of
Lines: 112
Message-ID: <87h67hzhm9.fsf@nosuchdomain.example.com>
References: <vi54e9$3ie0o$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>
<86ser1kgp5.fsf@linuxsc.com> <vit69t$1qfgg$1@dont-email.me>
<87ldwtzlc0.fsf@nosuchdomain.example.com>
<vitjgg$1tukq$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Fri, 06 Dec 2024 03:10:28 +0100 (CET)
Injection-Info: dont-email.me; posting-host="121d8a154b7fcd6212a7afdcdc69d1a5";
logging-data="2075318"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19l5ZbOnZ9T8MXKztmKSPyb"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:EHSRPyZwgHxCRRcA6e5fxKC4JNQ=
sha1:QK2ZqnYAl2d3mavr0ydwXgCRV20=
Bytes: 5859
Bart <bc@freeuk.com> writes:
> On 06/12/2024 00:50, Keith Thompson wrote:
>> Bart <bc@freeuk.com> writes:
>> [...]
>>> This is a discussion of language design. Not one person trying to
>>> understand how some feature works. I could learn how X works, but that
>>> won't help a million others with the same issue.
>> That's great, if there are a million other users who are confused
>> about the same things you claim to be confused about, and if you're
>> actually trying to help them.
>> Except for a couple of things.
>> I don't believe there are "a million other users" who are confused
>> about, to use a recent example, C's rules about whether a "}" needs
>> to be followed by a semicolon. I've seen code with extraneous
>> semicolons at file scope, and I mostly blame gcc's lax default
>> behavior for that. But I've never heard anyone other than you
>> complain about C's rules being intolerably inconsistent.
>> And even if those users exist, I don't see you making any effort
>> to help them, for example by explaining how C actually works.
>> (Though you do manage to provoke some of us into doing that for you.)
>
> You really think I'm a beginner stumped on some vital question of
> whether I should or should not have use a semicolon in a program I'm
> writing?
No, but I think you pretend to be, because you want to make C appear
more confusing than it really is.
> I said I wouldn't be able explain the rules. Otherwise I stumble along
> like everyone else.
So what's your point? There are plenty of people here who can explain
the rules. I've explained them to you. It never helps.
> If I catch sight of this at the top of my screen window:
>
> -------------------------
> }
>
> ....
>
> is that } ending some compound statement, or is it missing a ";"
> because it's initialising some data? Or (if I know I'm outside a
> function), is it the end of function definition?
>
> I wouldn't be stumped for long, but it strikes me as odd that you
> can't tell just by looking.
Seriously? Ok, it strikes you as odd. Acknowledged.
Meaning can depend on context.
You can complain about it on a public forum, or you can scroll up.
> I used to be puzzled by this too: 'while' can both start a while
> statement, and it can delimit a do-while statement. How is that
> possible?
It's possible because meaning can depend on context.
You know that, of course. Why do you ask?
> Again if you only caught a glimpse like this:
>
> ----------------
> while (cond);
>
> then /probably/ it is the last line of a do-while, but it could also
> legally be a while loop with an empty body. (Maybe temporarily empty,
> or the ; is a mistake.)
>
> How about this:
>
> do
> {
> ....
> }
> while cond();
>
> A do-while, but comment out the 'do', and it's a compound statement
> followed by a while loop
You forgot the parentheses around the condition.
> This duality of 'while' bothers me.
Noted as yet another thing that bothers you.
> (I can't have repeat-while in my syntax because it doesn't work;
> 'while' is always the start of a new while-loop. So I'm interested in
> how C manages it. But it looks fragile.)
It's not. The grammar for while loops and do loops is unambiguous.
I may have mentioned previously that C's syntax is what I call
"dense", by which I mean that a small change in a valid C program
can result in another valid C program with a different meaning.
Now, suppose that one of your "million others with the same issue"
were genuinely having difficulty understanding a lone "}" at the top
of the screen, or the two uses of "while (condition)". You've done
nothing to help this hypothetical user. You've only complained to a
community of C programmers who are already aware of all the supposd
issues you're talking about. And when you ask an actual question,
you rarely if ever acknowledge others' efforts to answer it.
Can you explain briefly just what you're trying to accomplish here?
And how is it working out for you?
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */