Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <vj1prj$35je4$1@dont-email.me>
Deutsch   English   Français   Italiano  
<vj1prj$35je4$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: Bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: question about linker
Date: Sat, 7 Dec 2024 15:33:08 +0000
Organization: A noiseless patient Spider
Lines: 105
Message-ID: <vj1prj$35je4$1@dont-email.me>
References: <vi54e9$3ie0o$1@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>
 <86ser1kgp5.fsf@linuxsc.com> <vit69t$1qfgg$1@dont-email.me>
 <87ldwtzlc0.fsf@nosuchdomain.example.com> <vitjgg$1tukq$2@dont-email.me>
 <vj1bss$325uo$1@dont-email.me> <vj1h4i$335q1$2@dont-email.me>
 <vj1mhi$34p7h$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 07 Dec 2024 16:33:07 +0100 (CET)
Injection-Info: dont-email.me; posting-host="92f4e16e4a21192eb5e2d0ba1a6ec304";
	logging-data="3329476"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19PMfJZcK5LTzAIpatXccmo"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:k2S85BrtGojq2itA9ZxjfAg5L88=
In-Reply-To: <vj1mhi$34p7h$1@dont-email.me>
Content-Language: en-GB
Bytes: 5288

On 07/12/2024 14:36, Janis Papanagnou wrote:
> On 07.12.2024 14:04, Bart wrote:

> 
> Just fine, I'd say.
> 
>> But it relies on some subtlety.
> 
> You seem to see ghosts. There's no subtlety; all is clearly defined,
> and it's a sensible feature, and consistently implemented.
> 
>> 'while (cond)' both starts a statement, and can
>> end a statement:
>>
>>     do while(cond) do ; while (cond);
> 
> What is this (IMO syntactical wrong "C" code) supposed to do or to
> explain?

See my follow-up.

> Your (wrong) second 'do' was indeed confusing! - Why did you provide
> a wrong sample to confirm your wrong ideas? - Or is it just your well
> known habit to try to confuse other folks as well my making up stupid
> things?

You're being aggressive. It was a mistake, that's all. My original 
example was meant to show how it gets confusing, but when I transcribed 
it into an actual program, it seemed to work because I'd left out that 'do'.

It says something however when I actually believed that that code was 
valid, because the compiler appeared to say so.

> Most here (and me too) already acknowledged that "C" is not obvious
> to you.

Why is it not possible for to acknowledge that some language design 
patterns may not be as obvious as others?

According to you, even if some construct can be determined to be 
unambiguous in some convoluted grammar, then it must also be 100% 
obvious to any human reader?

Is it just to avoid admitting that I might have a point?


>> You don't think there is an element of ambiguity here?
> 
> There isn't any.

So you're a parser and you see this:

     do ... while

How do you know whether that 'while' starts a new nested loop or 
terminates this one?

What does it depend on; what property of blocks in the language is 
needed to make it work? What property of statement separators or 
terminators is needed.

In C, it apparently relies on blocks (that is, the statements in a loop 
body) being only a single statement, as it is in C. So the pattern is this:

   do {...} while ...
   do stmt; while ...
   do ; while ...

But not however these:

   do {...}; while ...
   do while ...            # this can't be the terminating while.

So it can't work in a syntax which allows N statements in a block:

   do s1; s2; s3; while ...

Since it can't tell whether that while is the terminator, or is another 
nested loop.

Now, you could have given a more measured, respectful reply and pointed 
these things out, instead of being condescending and patronising.

You might also have pointed out that C could have deprecated null 
statements consisting of a single ";", and required the more visible 
"{}", as some compilers can be requested to do. Since such a ";" can 
instroduce very subtle errors that are hard to spot.

That the option exists suggests that some people do have trouble with 
it. But your attitude appears to be the arrogant one that because it is 
technically unambiguous, then ANYONE should be able to spot such errors.

And if they can't then they should spend more time studying manuals, 
choose a different language, or give up coding altogether.

In your book, it's fine to write expressions like this:

   a + b & c * d == f < g | h ? i ^ j : k && l

without parentheses, because the C grammar is 100% unambiguous in what 
it means.

That is really not helpful.