Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

19 May, 2024: Line wrapping has been changed to be more consistent with Usenet standards.
 If you find that it is broken please let me know here rocksolid.nodes.help


devel / comp.lang.c / Re: How About Disallowing Assignments In Expressions?

SubjectAuthor
* How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
+* Re: How About Disallowing Assignments In Expressions?Malcolm McLean
|`* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| `- Re: How About Disallowing Assignments In Expressions?Tim Rentsch
+- Re: How About Disallowing Assignments In Expressions?Kaz Kylheku
+* Re: How About Disallowing Assignments In Expressions?David Brown
|+* Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
||+* Re: How About Disallowing Assignments In Expressions?Richard Harnden
|||`* Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
||| `* Re: How About Disallowing Assignments In Expressions?Richard Harnden
|||  `* Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
|||   `* Re: How About Disallowing Assignments In Expressions?Malcolm McLean
|||    `* Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
|||     `- Re: How About Disallowing Assignments In Expressions?Malcolm McLean
||`* Re: How About Disallowing Assignments In Expressions?David Brown
|| +* Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
|| |`- Re: How About Disallowing Assignments In Expressions?David Brown
|| `- Re: How About Disallowing Assignments In Expressions?Janis Papanagnou
|+- Re: How About Disallowing Assignments In Expressions?Kaz Kylheku
|`* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| +* Re: How About Disallowing Assignments In Expressions?Malcolm McLean
| |+- Re: How About Disallowing Assignments In Expressions?Keith Thompson
| |`* Re: How About Disallowing Assignments In Expressions?bart
| | +* Re: How About Disallowing Assignments In Expressions?fir
| | |`- Re: How About Disallowing Assignments In Expressions?fir
| | `* Re: How About Disallowing Assignments In Expressions?fir
| |  `* Re: How About Disallowing Assignments In Expressions?fir
| |   +- Re: How About Disallowing Assignments In Expressions?fir
| |   `- Re: How About Disallowing Assignments In Expressions?fir
| +* Re: How About Disallowing Assignments In Expressions?Kaz Kylheku
| |+- Re: How About Disallowing Assignments In Expressions?Keith Thompson
| |`* Re: How About Disallowing Assignments In Expressions?bart
| | +- Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | `- Re: How About Disallowing Assignments In Expressions?Kaz Kylheku
| +- Re: How About Disallowing Assignments In Expressions?David Brown
| +* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| |+- Re: How About Disallowing Assignments In Expressions?fir
| |`* Re: How About Disallowing Assignments In Expressions?Kaz Kylheku
| | `* Re: How About Disallowing Assignments In Expressions?dave thompson 2
| |  +* Re: How About Disallowing Assignments In Expressions?Janis Papanagnou
| |  |`- Re: How About Disallowing Assignments In Expressions?bart
| |  `- Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| +* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| |+* Re: How About Disallowing Assignments In Expressions?Kaz Kylheku
| ||`* Re: How About Disallowing Assignments In Expressions?David Brown
| || `- Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| |+* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| ||`* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| || `* Re: How About Disallowing Assignments In Expressions?David Brown
| ||  +* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| ||  |`- Re: How About Disallowing Assignments In Expressions?David Brown
| ||  `- Re: How About Disallowing Assignments In Expressions?Janis Papanagnou
| |`* Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
| | +* Re: How About Disallowing Assignments In Expressions?David Brown
| | |+* Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
| | ||+- Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
| | ||+* Re: How About Disallowing Assignments In Expressions?bart
| | |||`- Re: How About Disallowing Assignments In Expressions?David Brown
| | ||+- Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | ||`- Re: How About Disallowing Assignments In Expressions?David Brown
| | |`* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | | `* Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
| | |  +* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | |  |`* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  | `* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | |  |  `* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   +* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | |  |   |`* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   | `* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | |  |   |  `* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   |   +* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   |   |`* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |   |   | `* Re: How About Disallowing Assignments In Expressions?bart
| | |  |   |   |  `* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |   |   |   +* Re: How About Disallowing Assignments In Expressions?bart
| | |  |   |   |   |`* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |   |   |   | `- Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   |   |   `* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   |   |    `- Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |   |   `* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | |  |   |    +- Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   |    `* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |   |     `* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | |  |   |      +* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   |      |`* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | |  |   |      | +- Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
| | |  |   |      | `- Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   |      `- Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |   `* Re: How About Disallowing Assignments In Expressions?Malcolm McLean
| | |  |    `* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |     +* Re: How About Disallowing Assignments In Expressions?Malcolm McLean
| | |  |     |`* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |     | `* Re: How About Disallowing Assignments In Expressions?Malcolm McLean
| | |  |     |  `* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |     |   `* Re: How About Disallowing Assignments In Expressions?Malcolm McLean
| | |  |     |    `* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |     |     +* Re: How About Disallowing Assignments In Expressions?Malcolm McLean
| | |  |     |     |`- Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |     |     `* Re: How About Disallowing Assignments In Expressions?bart
| | |  |     |      +- Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
| | |  |     |      `* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |     +* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | |  |     `* Re: How About Disallowing Assignments In Expressions?Janis Papanagnou
| | |  `* Re: How About Disallowing Assignments In Expressions?David Brown
| | +* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | `- Re: How About Disallowing Assignments In Expressions?Keith Thompson
| +- Re: How About Disallowing Assignments In Expressions?Janis Papanagnou
| `* Re: How About Disallowing Assignments In Expressions?Michael S
+* Re: How About Disallowing Assignments In Expressions?bart
+* Re: How About Disallowing Assignments In Expressions?Blue-Maned_Hawk
+- Re: How About Disallowing Assignments In Expressions?Richard Kettlewell
`* Re: How About Disallowing Assignments In Expressions?Thiago Adams

Pages:123456789101112131415161718192021
Re: How About Disallowing Assignments In Expressions?

<uqkjm6$379pl$10@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34718&group=comp.lang.c#34718

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 15 Feb 2024 08:57:42 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <uqkjm6$379pl$10@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uq6nha$2spqe$3@dont-email.me>
<87sf20o4e2.fsf@bsb.me.uk> <uq86e9$37s7s$1@dont-email.me>
<uq93m2$3g3f$2@dont-email.me> <8734tzoli4.fsf@bsb.me.uk>
<uq979e$40n1$1@dont-email.me> <87v86vbx6s.fsf@nosuchdomain.example.com>
<uq98lm$40n1$6@dont-email.me> <87il2vbvza.fsf@nosuchdomain.example.com>
<uqau5o$11nm8$1@dont-email.me> <uqauo4$11vps$1@dont-email.me>
<uqb1vc$12k3v$1@dont-email.me> <uqd039$1fnp7$1@dont-email.me>
<uqduum$1mm6v$1@dont-email.me> <uqf801$20hb9$1@dont-email.me>
<uqfd4d$21bu6$1@dont-email.me> <uqfgnv$21tva$1@dont-email.me>
<uqfngh$235bb$1@dont-email.me> <uqft7s$2458n$1@dont-email.me>
<uqg1bv$24to4$1@dont-email.me> <877cj8axo6.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 15 Feb 2024 08:57:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="06d12749e5def29a78db342a8b927267";
logging-data="3385141"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FfdPS5EB5xmaQDOl1krhO"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:VrzdywIaKu+Q86TeSBjtov7WyRg=
 by: Lawrence D'Oliv - Thu, 15 Feb 2024 08:57 UTC

On Tue, 13 Feb 2024 12:58:49 -0800, Keith Thompson wrote:

> You're suggesting that correctness doesn't matter unless the software
> controls nuclear missiles.

I would be hoping that safety-critical software would be written to higher
standards than military stuff.

After all, in military operations, a “friendly fire” rate of, say, 10-25%,
seems to be considered acceptable.

Re: How About Disallowing Assignments In Expressions?

<uqkjp1$379pl$11@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34719&group=comp.lang.c#34719

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 15 Feb 2024 08:59:14 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <uqkjp1$379pl$11@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uq86e9$37s7s$1@dont-email.me>
<uq93m2$3g3f$2@dont-email.me> <8734tzoli4.fsf@bsb.me.uk>
<uq979e$40n1$1@dont-email.me> <87v86vbx6s.fsf@nosuchdomain.example.com>
<uq98lm$40n1$6@dont-email.me> <87il2vbvza.fsf@nosuchdomain.example.com>
<uqau5o$11nm8$1@dont-email.me> <uqauo4$11vps$1@dont-email.me>
<uqbrjo$16jcf$6@dont-email.me> <uqg3m0$258lu$5@dont-email.me>
<uqgpd1$29928$3@dont-email.me> <87il2s9fdj.fsf@nosuchdomain.example.com>
<uqj95e$2qhb1$1@dont-email.me> <sEazN.324764$Wp_8.34532@fx17.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 15 Feb 2024 08:59:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="06d12749e5def29a78db342a8b927267";
logging-data="3385141"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+1kAeH10JndorgAJ25cgoy"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:aD/ciVcTMp1b9958AxHBqCCrjXA=
 by: Lawrence D'Oliv - Thu, 15 Feb 2024 08:59 UTC

On Wed, 14 Feb 2024 21:54:32 GMT, Scott Lurndal wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
>>On Tue, 13 Feb 2024 14:19:20 -0800, Keith Thompson wrote:
>>
>>> But C has a *lot* of precedence levels, and they're not all obvious.
>>>
>>> If I see `a | b ^ c`, I'm not likely to remember off the top of my
>>> head ...
>>
>>So don’t remember “off the top of your head”: keep the docs handy.
>>That’s what I do.
>
> Why? The code is easier to read and maintain if the precedence is made
> explicit.

You’re assuming that the parenthesis clutter has negligible effect on
readability. That may be OK with one or two extraneous pairs, but typical
C code tends to end up with a lot more than that.

Re: How About Disallowing Assignments In Expressions?

<uqkjr0$379pl$12@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34720&group=comp.lang.c#34720

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!nntp.comgw.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 15 Feb 2024 09:00:16 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <uqkjr0$379pl$12@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uq4nmb$2hive$6@dont-email.me>
<87r0hlef8q.fsf@nosuchdomain.example.com> <uq6nha$2spqe$3@dont-email.me>
<87sf20o4e2.fsf@bsb.me.uk> <uq86e9$37s7s$1@dont-email.me>
<uq93m2$3g3f$2@dont-email.me> <8734tzoli4.fsf@bsb.me.uk>
<uq979e$40n1$1@dont-email.me> <87v86vbx6s.fsf@nosuchdomain.example.com>
<uq98lm$40n1$6@dont-email.me> <87il2vbvza.fsf@nosuchdomain.example.com>
<uqau5o$11nm8$1@dont-email.me> <uqauo4$11vps$1@dont-email.me>
<uqbrjo$16jcf$6@dont-email.me> <uqg3m0$258lu$5@dont-email.me>
<uqgpd1$29928$3@dont-email.me> <uqgtcs$2a1g3$1@dont-email.me>
<uqj976$2qhb1$2@dont-email.me> <uqkcph$36i3s$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 15 Feb 2024 09:00:16 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="06d12749e5def29a78db342a8b927267";
logging-data="3385141"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+LUkf2+kzXgfBpb5JjEpJO"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:Y9VYdt8V7/MDKHF03PzVutUM/2A=
 by: Lawrence D'Oliv - Thu, 15 Feb 2024 09:00 UTC

On Thu, 15 Feb 2024 08:00:00 +0100, Janis Papanagnou wrote:

> On 14.02.2024 21:52, Lawrence D'Oliveiro wrote:
>
>> On Wed, 14 Feb 2024 00:18:50 +0100, Janis Papanagnou wrote:
>>
>>> Though most precedence rules in C make parenthesis usually unnecessary
>>> and expressions rarely need parenthesis to provide that certainty.
>>
>> And yet you were the one who added unnecessary ones in your example, I
>> didn’t.
>
> Yes, and I explained that with the given rules you have no "clutter"
> (as you called it) ...

“Clutter” is when you put in ones you don’t need.

If Marie Kondo were to learn C programming, what do you think she would
do?

Re: How About Disallowing Assignments In Expressions?

<uqkk70$37m01$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34721&group=comp.lang.c#34721

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 15 Feb 2024 10:06:40 +0100
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <uqkk70$37m01$1@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uq4nmb$2hive$6@dont-email.me>
<87r0hlef8q.fsf@nosuchdomain.example.com> <uq6nha$2spqe$3@dont-email.me>
<87sf20o4e2.fsf@bsb.me.uk> <uq86e9$37s7s$1@dont-email.me>
<uq93m2$3g3f$2@dont-email.me> <8734tzoli4.fsf@bsb.me.uk>
<uq979e$40n1$1@dont-email.me> <87v86vbx6s.fsf@nosuchdomain.example.com>
<uq98lm$40n1$6@dont-email.me> <87il2vbvza.fsf@nosuchdomain.example.com>
<uq9m1n$bfj9$1@dont-email.me> <87eddjblyh.fsf@nosuchdomain.example.com>
<uqbrgt$16jcf$5@dont-email.me> <87bk8m9xzw.fsf@nosuchdomain.example.com>
<uqc4dc$1bn4b$1@dont-email.me> <uqcv3o$1fikf$1@dont-email.me>
<uqjc8o$2r2ac$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 15 Feb 2024 09:06:40 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4840a2d7738947bd2d0aeb9818838af8";
logging-data="3397633"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Pz5Dc3TYIvK/k3F4XYGvGOlD+ZgSz7SA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:u5fqNspc7VPD2PH4rk0On6FwCx0=
Content-Language: en-GB
In-Reply-To: <uqjc8o$2r2ac$3@dont-email.me>
 by: David Brown - Thu, 15 Feb 2024 09:06 UTC

On 14/02/2024 22:44, Lawrence D'Oliveiro wrote:
> On Mon, 12 Feb 2024 12:23:35 +0100, David Brown wrote:
>
>> Do you know what "incompatible types" are, and what they mean? Do you
>> realise that they cannot be swapped around as you suggest?
>
> And yet, all the examples posted so far have involved, not the actual
> types, but pointers to them.

Keith's post explains about pointers to incompatible types.

Compatibility is also relevant for declarations. All declarations of
the same function or object with external linkage must be the same
within a program. It is undefined behaviour to have this :

int foo(int);

and this :

int foo(long int);

in the same program. That is true even if "int" and "long int" have the
same size, or are passed using the same ABI conventions. Compilers will
complain if they are within the same translation unit, but it is
undefined (and usually not diagnosed) if they are in different
translation units.

There are /many/ situations where types must be compatible. I don't
want to try to list all the rules here - you can look them up yourself.

Re: Building Code Again

<uqkp70$394h1$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34723&group=comp.lang.c#34723

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.chmurka.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: Building Code Again
Date: Thu, 15 Feb 2024 10:32:00 +0000
Organization: A noiseless patient Spider
Lines: 226
Message-ID: <uqkp70$394h1$1@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me>
<877cj8axo6.fsf@nosuchdomain.example.com> <uqgs2c$29nvr$1@dont-email.me>
<uqhtvp$2ilrc$1@dont-email.me> <uqi1f2$2j7mt$1@dont-email.me>
<uqi3k1$2jhr8$1@dont-email.me> <uqi886$2kcqi$1@dont-email.me>
<20240214141410.00005ea0@yahoo.com> <uqii13$2m36v$1@dont-email.me>
<3v5zN.88071$GX69.76625@fx46.iad> <uqirrb$2o09g$1@dont-email.me>
<Sa7zN.358881$xHn7.264957@fx14.iad> <uqj4ml$2pnqa$1@dont-email.me>
<uqj6iv$2q00f$1@dont-email.me> <uqj9nj$2ql12$1@dont-email.me>
<3yazN.324761$Wp_8.75995@fx17.iad> <uqjo4k$2t0ca$1@dont-email.me>
<uqkjjk$379pl$9@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 15 Feb 2024 10:32:00 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="02d8ac7ffc12f179390259c847a21c25";
logging-data="3445281"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/53Eblev9oTfqxpgXAMQlF2Yxr9Iz5IhE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:53Ekn9JdW0R3j22BPqNiR4yQ3c8=
In-Reply-To: <uqkjjk$379pl$9@dont-email.me>
Content-Language: en-GB
 by: bart - Thu, 15 Feb 2024 10:32 UTC

On 15/02/2024 08:56, Lawrence D'Oliveiro wrote:
> On Thu, 15 Feb 2024 01:07:33 +0000, bart wrote:
>
>> Bollocks it is.
>
> You keep insisting so. It would be simple enough to prove your point, by
> stripping out this “needless” complexity and proving you can build the
> code much more simply.
>
> Otherwise, you just fall into the “methinks he doth protest too much”
> school of Windows sufferers.

This is exactly what I started doing, with a view to extracting some
parts of it since I didn't need a 270Kloc library.

Below is as far as I got in about an hour. This reads a PGM file from
stdin, and writes a PGM file to stdout. This only does the headers. I
need to decide what processing to do on the image data read from stdin
before it's passed to stdout; I had in mind simply inverting the data.

However, I just didn't like how it was done. The following is distilled
quite a bit; if I wrote it, it would be a lot more compact. But
generally reading and writing files like PGM is so trivial, that it
would be easier to write it myself from scratch.

I also like to read an entire file into a buffer, and write out an
entire file, while this code prefers to do that serially. I gave an
example of how that works now for me:

a := bmload("test.pgm")
bmsave("itest.pgm", bmneg(a))

The point is, the C file below, even when completed, needs no special
configuration process, no scripts, no makefiles, you just use a C compiler:

c:\c>mcc inv
Compiling inv.c to inv.exe

c:\c>inv <test.pgm
P5
600 800
255

But perhaps /you/ can explain why such a INVERT tool would needs such an
elaborate process:

c:\net>mcc pnminvert.c
Compiling pnminvert.c to pnminvert.exe
netpbm/pm_config.h 18
Can't find include file in:netpbm/pm.h Line: 17

Even if I use WSL to get a pm_config.h file, it goes wrong on something
else.

------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>

#define PGM_MAGIC1 'P'
#define PGM_MAGIC2 '2'
#define RPGM_MAGIC2 '5'
#define PGM_FORMAT (PGM_MAGIC1 * 256 + PGM_MAGIC2)
#define RPGM_FORMAT (PGM_MAGIC1 * 256 + RPGM_MAGIC2)
#define PGM_TYPE PGM_FORMAT

void pm_error(char* mess) {
puts(mess);
exit(1);
}

void pm_error2(char* mess, int ich) {
printf(mess, ich);
exit(1);
}

char pm_getc(FILE * const fileP) {
int ich;
char ch;

ich = getc(fileP);
if (ich == EOF)
pm_error("EOF / read error reading a byte");
ch = (char) ich;

if (ch == '#') {
do {
ich = getc(fileP);
if (ich == EOF)
pm_error("EOF / read error reading a byte");
ch = (char) ich;
} while (ch != '\n' && ch != '\r');
}
return ch;
}

int pm_readmagicnumber(FILE * const ifP) {

int ich1, ich2;

ich1 = getc(ifP);

if (ich1 == EOF)
pm_error("Error reading first byte of what is expected to be "
"a Netpbm magic number. "
"Most often, this means your input file is empty");

ich2 = getc(ifP);

if (ich2 == EOF)
pm_error2("Error reading second byte of what is expected to be "
"a Netpbm magic number (the first byte was successfully "
"read as 0x%02x)", ich1);

return ich1 * 256 + ich2;
}

unsigned int pm_getuint(FILE * const ifP) {
char ch;
unsigned int i;

do {
ch = pm_getc(ifP);
} while (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r');

if (ch < '0' || ch > '9')
pm_error("junk in file where an unsigned integer should be");

i = 0;
do {
unsigned int const digitVal = ch - '0';

if (i > INT_MAX/10)
pm_error("ASCII decimal integer in file is "
"too large to be processed. ");

i *= 10;

if (i > INT_MAX - digitVal)
pm_error("ASCII decimal integer in file is "
"too large to be processed. ");

i += digitVal;

ch = pm_getc(ifP);
} while (ch >= '0' && ch <= '9');

return i;
}

void pgm_readpgminitrest(FILE * const fileP,
int * const colsP,
int * const rowsP,
int * const maxvalP) {

int maxval;

/* Read size. */
*colsP = (int)pm_getuint(fileP);
*rowsP = (int)pm_getuint(fileP);

/* Read maxval. */
maxval = pm_getuint(fileP);
*maxvalP = maxval;
}

void pgm_readpgminit(FILE * const fileP,
int * const colsP,
int * const rowsP,
int * const maxvalP,
int * const formatP) {

int realFormat;

/* Check magic number. */
realFormat = pm_readmagicnumber(fileP);

switch (realFormat) {
case PGM_TYPE:
*formatP = realFormat;
pgm_readpgminitrest(fileP, colsP, rowsP, maxvalP);
break;

default:
pm_error2("bad magic number 0x%x - not a PPM, PGM, PBM, or PAM
file",
realFormat);
}
}

void pgm_writepgminit(FILE * const fileP,
int const cols,
int const rows,
int const maxval,
int const binary) {

fprintf(fileP, "%c%c\n%d %d\n%d\n",
PGM_MAGIC1,
binary? PGM_MAGIC2 : RPGM_MAGIC2,
cols, rows, maxval );
}

int main(void) {
FILE* f = stdin;
FILE* g = stdout;
int rows, cols, format, maxval;

pgm_readpgminit(f, &cols, &rows, &maxval, &format);
pgm_writepgminit(g, cols, rows, maxval, 0);
//
// if (PNM_FORMAT_TYPE(format) == PBM_TYPE)
// /* Take fast path */
// invertPbm(ifP, stdout, cols, rows, format);
// else
// /* PPM , PGM (logic also works for PBM) */
// invertPnm(ifP, stdout, cols, rows, maxval, format);
//
// pm_close(ifP);
// pm_close(stdout);
fclose(f);
fclose(g);
}

Re: Building Code Again

<uqktfq$39qk3$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34724&group=comp.lang.c#34724

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: Building Code Again
Date: Thu, 15 Feb 2024 11:44:58 +0000
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <uqktfq$39qk3$1@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me>
<877cj8axo6.fsf@nosuchdomain.example.com> <uqgs2c$29nvr$1@dont-email.me>
<uqhtvp$2ilrc$1@dont-email.me> <uqi1f2$2j7mt$1@dont-email.me>
<uqi3k1$2jhr8$1@dont-email.me> <uqi886$2kcqi$1@dont-email.me>
<20240214141410.00005ea0@yahoo.com> <uqii13$2m36v$1@dont-email.me>
<3v5zN.88071$GX69.76625@fx46.iad> <uqirrb$2o09g$1@dont-email.me>
<Sa7zN.358881$xHn7.264957@fx14.iad> <uqj4ml$2pnqa$1@dont-email.me>
<uqj6iv$2q00f$1@dont-email.me> <uqj9nj$2ql12$1@dont-email.me>
<3yazN.324761$Wp_8.75995@fx17.iad> <uqjo4k$2t0ca$1@dont-email.me>
<20240214190516.111@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 15 Feb 2024 11:44:58 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="02d8ac7ffc12f179390259c847a21c25";
logging-data="3467907"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19hb2o57eZeDjA3I9FoVUzfRXFUslsiGD4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:hyu5TQSnpx9L4VWbwy7OMYcLB+s=
In-Reply-To: <20240214190516.111@kylheku.com>
Content-Language: en-GB
 by: bart - Thu, 15 Feb 2024 11:44 UTC

On 15/02/2024 03:08, Kaz Kylheku wrote:
> On 2024-02-15, bart <bc@freeuk.com> wrote:
>> There appears to be nobody in Unix who questions such things; everyone
>> takes takes at face value. So long as it eventually produces a result,
>> no matter how long it takes or how torturous the process, nobody cares.
>
> This is false. There are many critics "in Unix", of Makefiles, GNU
> Autotools, the C language including its preprocessing, the shell
> language, various utilities, POSIX API's, and almost imaginable element
> of the whole cornucopia. Many are well-informed, experienced and have
> well-reasoned opinions.
>

And yet I still can't trivially compile pnminvert.c into pnminvert.exe
using just a C compiler.

I need X, Y and Z to do so under WSL, and it still doesn't work. The
following is after going through an interactive configure process
(apparently I need half a dozen existing image DLLs already installed
(isn't this supposed to replace them?), plus Libxml2, plus flex, plus my
mingw installation apparently doesn't support all needed features.

Even the message from the config process says, Do not be surprised if
make fails.

(This stuff always reminds me of the Tootsie-Frootsie sketch from the
Marx Bros' A Day at the Races. You start with a simple requirement then
end up with a massive pile of junk that in the end is unusable.)

-----------------------
.....
make[2]: Leaving directory '/mnt/c/xxx/netpbm-10.86.40/lib/util'
cc -shared -Wl,--image-base=0x10000000 -Wl,--enable-auto-import
-Wl,--export-all-symbols \
-Wl,-soname,libnetpbm10.dll \
-Wl,--output-def,libnetpbm10.def \
-Wl,--out-implib,libnetpbm.dll.a -o libnetpbm10.dll \
libpm.o pmfileio.o fileio.o colorname.o libpamd.o libpbm1.o
libpbm2.o libpbm3.o libpbmfont0.o libpbmfont1.o libpbmfont2.o
pbmfontdata0.o pbmfontdata1.o pbmfontdata2.o libpgm1.o libpgm2.o
libppm1.o libppm2.o libppmcmap.o libppmcolor.o libppmfuzzy.o libppmd.o
ppmdfont.o standardppmdfont.o path.o libppmfloyd.o libpnm1.o libpnm2.o
libpnm3.o libpam.o libpamread.o libpamwrite.o libpamn.o libpammap.o
libpamcolor.o libsystem.o util/bitio.o util/filename.o util/io.o
util/mallocvar.o util/matrix.o util/nsleep.o util/nstring.o
util/runlength.o util/shhopt.o util/token.o util/vasprintf.o
/usr/bin/ld: unrecognized option '--image-base=0x10000000'
/usr/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
make[1]: *** [/mnt/c/xxx/netpbm-10.86.40//lib/Makefile:143:
libnetpbm10.dll] Error 1
make[1]: Leaving directory '/mnt/c/xxx/netpbm-10.86.40/lib'
make: *** [/mnt/c/xxx/netpbm-10.86.40/common.mk:573: lib/all] Error 2

Re: How About Disallowing Assignments In Expressions?

<uql32m$3apfo$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34725&group=comp.lang.c#34725

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 15 Feb 2024 14:20:21 +0100
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <uql32m$3apfo$1@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uq86e9$37s7s$1@dont-email.me>
<uq93m2$3g3f$2@dont-email.me> <8734tzoli4.fsf@bsb.me.uk>
<uq979e$40n1$1@dont-email.me> <87v86vbx6s.fsf@nosuchdomain.example.com>
<uq98lm$40n1$6@dont-email.me> <87il2vbvza.fsf@nosuchdomain.example.com>
<uqau5o$11nm8$1@dont-email.me> <uqauo4$11vps$1@dont-email.me>
<uqbrjo$16jcf$6@dont-email.me> <uqg3m0$258lu$5@dont-email.me>
<uqgpd1$29928$3@dont-email.me> <87il2s9fdj.fsf@nosuchdomain.example.com>
<uqj95e$2qhb1$1@dont-email.me> <sEazN.324764$Wp_8.34532@fx17.iad>
<86wmr6z0zg.fsf@linuxsc.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 15 Feb 2024 13:20:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4840a2d7738947bd2d0aeb9818838af8";
logging-data="3499512"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Au8uGjTLjm+wyd5vhU4nYrYxqTcCAyv8="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:Ad8oRMx0escbNQHq/0tUUPpQAoI=
Content-Language: en-GB
In-Reply-To: <86wmr6z0zg.fsf@linuxsc.com>
 by: David Brown - Thu, 15 Feb 2024 13:20 UTC

On 15/02/2024 07:37, Tim Rentsch wrote:
> scott@slp53.sl.home (Scott Lurndal) writes:
>
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>
>>> On Tue, 13 Feb 2024 14:19:20 -0800, Keith Thompson wrote:
>>>
>>>> But C has a *lot* of precedence levels, and they're not all
>>>> obvious.
>>>>
>>>> If I see `a | b ^ c`, I'm not likely to remember off the top of my
>>>> head ...
>>>
>>> So don't remember off the top of your head, [just] keep the docs
>>> handy. That's what I do.
>>
>> Why? The code is easier to read and maintain if the precedence is
>> made explicit.
>
> Every serious C developer should know all the operator precedence
> relationships without having to look them up.
>

<https://en.wikipedia.org/wiki/No_true_Scotsman>

/Serious/ developers write code that is as clear as they can. They know
where references are for when they need them, but do not waste cognitive
effort memorising things that are better expressed in a different way
(such as by using parentheses or breaking expressions into parts).

> In cases where it is still felt necessary to indicate how different
> operators parse with respect to one another, it's better to do that
> using spacing than with parentheses, as for example
>
> a | b^c
>
> or
>
> alpha | beta ^ gamma
>

No, that is the silliest thing to do. Don't write code that looks like
what you think it should mean - even if it happens to match the somewhat
arbitrary choices of a language. Write code that does exactly what you
mean, clearly and unequivocally, and requires the minimum of cognitive
effort on the part of the reader.

People make mistakes, even if they are "serious C developers". And if
you start using spaces to make it look like you are correct, neither you
nor others looking at the code will notice mistakes like :

alpha ^ beta | gamma

If you use parentheses for less common operator precedence cases, as
Keith suggests, your code will be clear and there will be an obvious and
immediate match between what the programmer intended, what the compiler
does, and what any reader (experienced or not) will see.

Re: How About Disallowing Assignments In Expressions?

<uql35j$3apfo$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34726&group=comp.lang.c#34726

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 15 Feb 2024 14:21:54 +0100
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <uql35j$3apfo$2@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uq86e9$37s7s$1@dont-email.me>
<uq93m2$3g3f$2@dont-email.me> <8734tzoli4.fsf@bsb.me.uk>
<uq979e$40n1$1@dont-email.me> <87v86vbx6s.fsf@nosuchdomain.example.com>
<uq98lm$40n1$6@dont-email.me> <87il2vbvza.fsf@nosuchdomain.example.com>
<uqau5o$11nm8$1@dont-email.me> <uqauo4$11vps$1@dont-email.me>
<uqbrjo$16jcf$6@dont-email.me> <uqg3m0$258lu$5@dont-email.me>
<uqgpd1$29928$3@dont-email.me> <87il2s9fdj.fsf@nosuchdomain.example.com>
<uqj95e$2qhb1$1@dont-email.me> <sEazN.324764$Wp_8.34532@fx17.iad>
<uqkjp1$379pl$11@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 15 Feb 2024 13:21:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4840a2d7738947bd2d0aeb9818838af8";
logging-data="3499512"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/VsoS0in1fIOOsBwqox1/w0cKrhoKklzg="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:Jcwk9ICBOOHoOvm9s2HmBPn5gDc=
In-Reply-To: <uqkjp1$379pl$11@dont-email.me>
Content-Language: en-GB
 by: David Brown - Thu, 15 Feb 2024 13:21 UTC

On 15/02/2024 09:59, Lawrence D'Oliveiro wrote:
> On Wed, 14 Feb 2024 21:54:32 GMT, Scott Lurndal wrote:
>
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>
>>> On Tue, 13 Feb 2024 14:19:20 -0800, Keith Thompson wrote:
>>>
>>>> But C has a *lot* of precedence levels, and they're not all obvious.
>>>>
>>>> If I see `a | b ^ c`, I'm not likely to remember off the top of my
>>>> head ...
>>>
>>> So don’t remember “off the top of your head”: keep the docs handy.
>>> That’s what I do.
>>
>> Why? The code is easier to read and maintain if the precedence is made
>> explicit.
>
> You’re assuming that the parenthesis clutter has negligible effect on
> readability. That may be OK with one or two extraneous pairs, but typical
> C code tends to end up with a lot more than that.

He was assuming the programmer used parentheses without it being "clutter".

Re: How About Disallowing Assignments In Expressions?

<uql39d$3apfo$3@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34727&group=comp.lang.c#34727

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 15 Feb 2024 14:23:57 +0100
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <uql39d$3apfo$3@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uq4nmb$2hive$6@dont-email.me>
<87r0hlef8q.fsf@nosuchdomain.example.com> <uq6nha$2spqe$3@dont-email.me>
<87sf20o4e2.fsf@bsb.me.uk> <uq86e9$37s7s$1@dont-email.me>
<uq93m2$3g3f$2@dont-email.me> <8734tzoli4.fsf@bsb.me.uk>
<uq979e$40n1$1@dont-email.me> <87v86vbx6s.fsf@nosuchdomain.example.com>
<uq98lm$40n1$6@dont-email.me> <87il2vbvza.fsf@nosuchdomain.example.com>
<uqau5o$11nm8$1@dont-email.me> <uqauo4$11vps$1@dont-email.me>
<uqbrjo$16jcf$6@dont-email.me> <uqg3m0$258lu$5@dont-email.me>
<uqgpd1$29928$3@dont-email.me> <uqgtcs$2a1g3$1@dont-email.me>
<uqj976$2qhb1$2@dont-email.me> <uqkcph$36i3s$1@dont-email.me>
<uqkjr0$379pl$12@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 15 Feb 2024 13:23:57 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4840a2d7738947bd2d0aeb9818838af8";
logging-data="3499512"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX188plzX18ObvMboFmyPvwW2+bgQd7o6qLs="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:A1z1kmDR5Vw4asIoSHPlpfncEbE=
In-Reply-To: <uqkjr0$379pl$12@dont-email.me>
Content-Language: en-GB
 by: David Brown - Thu, 15 Feb 2024 13:23 UTC

On 15/02/2024 10:00, Lawrence D'Oliveiro wrote:
> On Thu, 15 Feb 2024 08:00:00 +0100, Janis Papanagnou wrote:
>
>> On 14.02.2024 21:52, Lawrence D'Oliveiro wrote:
>>
>>> On Wed, 14 Feb 2024 00:18:50 +0100, Janis Papanagnou wrote:
>>>
>>>> Though most precedence rules in C make parenthesis usually unnecessary
>>>> and expressions rarely need parenthesis to provide that certainty.
>>>
>>> And yet you were the one who added unnecessary ones in your example, I
>>> didn’t.
>>
>> Yes, and I explained that with the given rules you have no "clutter"
>> (as you called it) ...
>
> “Clutter” is when you put in ones you don’t need.

So now we are going to have to introduce terms like Lawrence-Clutter to
go along with Malcolm-functions?

>
> If Marie Kondo were to learn C programming, what do you think she would
> do?

Re: [OT] Pascal and popularity (was Re: How About Disallowing Assignments In Expressions?)

<uql3sb$3athj$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34728&group=comp.lang.c#34728

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: [OT] Pascal and popularity (was Re: How About Disallowing
Assignments In Expressions?)
Date: Thu, 15 Feb 2024 14:34:02 +0100
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <uql3sb$3athj$1@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uq4nmb$2hive$6@dont-email.me>
<87r0hlef8q.fsf@nosuchdomain.example.com> <uq6nha$2spqe$3@dont-email.me>
<87sf20o4e2.fsf@bsb.me.uk> <uq86e9$37s7s$1@dont-email.me>
<uq93m2$3g3f$2@dont-email.me> <8734tzoli4.fsf@bsb.me.uk>
<uq979e$40n1$1@dont-email.me> <87v86vbx6s.fsf@nosuchdomain.example.com>
<uq98lm$40n1$6@dont-email.me> <87il2vbvza.fsf@nosuchdomain.example.com>
<uqau5o$11nm8$1@dont-email.me> <uqauo4$11vps$1@dont-email.me>
<uqg3dk$258lu$4@dont-email.me> <uqg4f3$25dn5$1@dont-email.me>
<uqgutd$2a91g$1@dont-email.me> <uqhule$2ilrc$2@dont-email.me>
<uqibhb$2kut0$1@dont-email.me> <uqiinc$2m4rb$1@dont-email.me>
<uqkceb$36go3$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 15 Feb 2024 13:34:03 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4840a2d7738947bd2d0aeb9818838af8";
logging-data="3503667"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19u+BnEbY2MTZT6EneM7HxokKx8wyf3t4Y="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:TqWP4h8HH6aEll48RRlSyvv0Cc4=
In-Reply-To: <uqkceb$36go3$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Thu, 15 Feb 2024 13:34 UTC

On 15/02/2024 07:54, Janis Papanagnou wrote:
> On 14.02.2024 15:29, David Brown wrote:
>> On 14/02/2024 13:26, Janis Papanagnou wrote:
>>> On 14.02.2024 09:46, David Brown wrote:
>>>>
>>>> I hadn't done much with C++ before then. At that time, most of my
>>>> professional programming was in assembly (on small microcontrollers) and
>>>> Pascal, with only some C.
>>>
>>> I'm surprised that Pascal was in professional use back then.[*]
>>> Pascal had always been derided as "academic" or "toy" language.
>>
>> In the DOS/Windows world, Pascal was a major language for a long time -
>> starting with Turbo Pascal, then Borland Pascal for DOS then Windows,
>> then Delphi. Delphi's descendants are still in heavy use for Windows
>> development. (And dotnet came from Delphi and related projects.)
>
> Yes, I'm aware of the "popularity" (as Michael called it) of especially
> the Turbo and Borland Pascal dialects [on DOS]. Being platform specific
> (for a "personal computer" platform) and being dialects they have never
> really been an option for our usage; popularity in general - and surely
> in DOS contexts! - was never a criterion for us. (Using standards was,
> though!) Yet, beyond popularity on DOS, I haven't heared much about it.
> Other languages of the Pascal languages branch, like Ada, certainly had
> their professional application areas (in aeronautics, for example)! But
> Pascal?
>

I agree that standard Pascal was not (AFAIK) hugely significant as a
development language outside of academia until the Turbo Pascal version
and its descendants in DOS/Windows. In particular, standard Pascal was
quite limited for "real" programs, so I believe that most people used
extended versions of various kinds. UCSD "p-System" Pascal was the most
popular version until Turbo Pascal.

Perhaps the most significant Pascal program is TeX, which was written in
a combined documentation/coding language "Web" using Pascal as the
programming language.

Re: How About Disallowing Assignments In Expressions?

<uql48p$3athj$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34729&group=comp.lang.c#34729

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!newsfeed.endofthelinebbs.com!nyheter.lysator.liu.se!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 15 Feb 2024 14:40:41 +0100
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <uql48p$3athj$2@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uq4nmb$2hive$6@dont-email.me>
<87r0hlef8q.fsf@nosuchdomain.example.com> <uq6nha$2spqe$3@dont-email.me>
<87sf20o4e2.fsf@bsb.me.uk> <uq8quh$3padl$13@dont-email.me>
<uqag7k$v4d8$8@dont-email.me> <uqg4h6$25gc3$1@dont-email.me>
<uqg5mn$25m88$1@dont-email.me> <uqh12g$2akab$1@dont-email.me>
<87a5o3amit.fsf@nosuchdomain.example.com> <20240214120232.00001d56@yahoo.com>
<Bm5zN.88069$GX69.22371@fx46.iad> <871q9f9go2.fsf@nosuchdomain.example.com>
<87a5o2lrd2.fsf@bsb.me.uk> <BDazN.324763$Wp_8.96522@fx17.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 15 Feb 2024 13:40:41 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4840a2d7738947bd2d0aeb9818838af8";
logging-data="3503667"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18n2MQeVNAYR6F+3KLW6eiCG75JQFbWeRE="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:zDeo4qirL0IjCHM/c+lGYHqnJCQ=
In-Reply-To: <BDazN.324763$Wp_8.96522@fx17.iad>
Content-Language: en-GB
 by: David Brown - Thu, 15 Feb 2024 13:40 UTC

On 14/02/2024 22:53, Scott Lurndal wrote:
>
> OTOH, all the systems the code in question run typedef uint64_t to unsigned
> long, so the 'ul' suffix works correctly in all forseeable usages in this
> application. And it's less to type than casting. Granted it's not
> particularly meaningful in the 0ul case, but it's a habit that does
> come in handy in expressions like
>
> uint64_t address;
> address = (0xcul << 44) | ((uint64_t)node << 44) | (device << 32) | register_offset;
>
> Yes, a cast on the constant would work as well. And yes, a good compiler
> will warn if the suffix is missing from the first constant value.

It would be better to use "ull", since there are lots of systems that
have 32-bit "long", but "long long" is always going to be at least
64-bit (and I have never heard of any where it is longer than that).

Re: How About Disallowing Assignments In Expressions?

<uql4lr$3avsv$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34730&group=comp.lang.c#34730

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 15 Feb 2024 13:47:39 +0000
Organization: A noiseless patient Spider
Lines: 70
Message-ID: <uql4lr$3avsv$1@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uq86e9$37s7s$1@dont-email.me>
<uq93m2$3g3f$2@dont-email.me> <8734tzoli4.fsf@bsb.me.uk>
<uq979e$40n1$1@dont-email.me> <87v86vbx6s.fsf@nosuchdomain.example.com>
<uq98lm$40n1$6@dont-email.me> <87il2vbvza.fsf@nosuchdomain.example.com>
<uqau5o$11nm8$1@dont-email.me> <uqauo4$11vps$1@dont-email.me>
<uqbrjo$16jcf$6@dont-email.me> <uqg3m0$258lu$5@dont-email.me>
<uqgpd1$29928$3@dont-email.me> <87il2s9fdj.fsf@nosuchdomain.example.com>
<uqj95e$2qhb1$1@dont-email.me> <sEazN.324764$Wp_8.34532@fx17.iad>
<86wmr6z0zg.fsf@linuxsc.com> <uql32m$3apfo$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 15 Feb 2024 13:47:39 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="02d8ac7ffc12f179390259c847a21c25";
logging-data="3506079"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+X3uWpP2fPQ6Q6E4/stpwzFKTnGiqvNyw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:rHQBNrHirWGvY/VU98GhVZ5V/MA=
Content-Language: en-GB
In-Reply-To: <uql32m$3apfo$1@dont-email.me>
 by: bart - Thu, 15 Feb 2024 13:47 UTC

On 15/02/2024 13:20, David Brown wrote:
> On 15/02/2024 07:37, Tim Rentsch wrote:
>> scott@slp53.sl.home (Scott Lurndal) writes:
>>
>>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>>
>>>> On Tue, 13 Feb 2024 14:19:20 -0800, Keith Thompson wrote:
>>>>
>>>>> But C has a *lot* of precedence levels, and they're not all
>>>>> obvious.
>>>>>
>>>>> If I see `a | b ^ c`, I'm not likely to remember off the top of my
>>>>> head ...
>>>>
>>>> So don't remember off the top of your head, [just] keep the docs
>>>> handy.  That's what I do.
>>>
>>> Why?  The code is easier to read and maintain if the precedence is
>>> made explicit.
>>
>> Every serious C developer should know all the operator precedence
>> relationships without having to look them up.
>>
>
> <https://en.wikipedia.org/wiki/No_true_Scotsman>
>
> /Serious/ developers write code that is as clear as they can.  They know
> where references are for when they need them, but do not waste cognitive
> effort memorising things that are better expressed in a different way
> (such as by using parentheses or breaking expressions into parts).
>
>> In cases where it is still felt necessary to indicate how different
>> operators parse with respect to one another, it's better to do that
>> using spacing than with parentheses, as for example
>>
>>      a | b^c
>>
>> or
>>
>>      alpha   |   beta ^ gamma
>>
>
> No, that is the silliest thing to do.  Don't write code that looks like
> what you think it should mean - even if it happens to match the somewhat
> arbitrary choices of a language.  Write code that does exactly what you
> mean, clearly and unequivocally, and requires the minimum of cognitive
> effort on the part of the reader.
>
> People make mistakes, even if they are "serious C developers".  And if
> you start using spaces to make it look like you are correct, neither you
> nor others looking at the code will notice mistakes like :
>
>     alpha   ^   beta | gamma
>
> If you use parentheses for less common operator precedence cases, as
> Keith suggests, your code will be clear and there will be an obvious and
> immediate match between what the programmer intended, what the compiler
> does, and what any reader (experienced or not) will see.

You have to wonder why the creators of C thought it was a good idea in
the first place to have so many precedence levels, if you're going to
end up using parentheses anyway to disambiguate.

There are 10 levels for binary operators (excl. augmented assignment);
for the same set of operators, I have only 5 for example.

I don't know about other languages, but splitting == != < <= >= > into
two levels is surely an odd thing to do, for a start.

Re: How About Disallowing Assignments In Expressions?

<86sf1tzuqc.fsf@linuxsc.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34731&group=comp.lang.c#34731

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17687@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 15 Feb 2024 06:07:39 -0800
Organization: A noiseless patient Spider
Lines: 61
Message-ID: <86sf1tzuqc.fsf@linuxsc.com>
References: <uq3s76$28dsr$1@dont-email.me> <uq5h7r$2mgb3$2@dont-email.me> <uq5i0r$2mkc4$1@dont-email.me> <uqg5do$25lge$1@dont-email.me> <20240213192257.00002da6@yahoo.com> <86jzn61ddb.fsf@linuxsc.com> <87jzn68d4s.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="d6a0776853173adee93a90f6ecdad10b";
logging-data="3514852"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18zeypagPkODbgL7pxyJj/4qF8PHp2xE/E="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:6QxERknCp3VsxxYHNJIepsGP0WY=
sha1:YZX3amBt1UYU4f+WbY7FjQH1T98=
 by: Tim Rentsch - Thu, 15 Feb 2024 14:07 UTC

Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>
>> Michael S <already5chosen@yahoo.com> writes:
>
> [...]
>
>> Here is another way to think about it.
>>
>> C (and many or most other languages) are fairly strict about what
>> is allowed on the left-hand side of an assignment. For example,
>>
>> a + b += c;
>>
>> is not allowed. Neither is
>>
>> (a + b) += c;
>>
>> although the reasoning is a little different in the two cases,
>> neither is allowed, because neither one makes sense.
>>
>> By analogy with the second example, the statement
>>
>> (a += b) += c;
>>
>> isn't allowed, because the left-hand side is wrong. So if we
>> see
>>
>> a += b += c;
>>
>> it would be silly to parse it as
>>
>> (a += b) += c;
>>
>> because that's illegal. The only other way to parse it, viz.,
>>
>> a += (b += c);
>>
>> passes the semantic prerequisites. Since it's the only way that
>> makes sense, it seems natural that (without any parentheses) the
>> syntax should reflect that.
>
> I don't think that reasoning is entirely solid.

My comments aren't meant as reasoning. They are meant to offer a
way of thinking that might help Michael S change his intuition
about how C assignment operators work. Personally I have no
problem with how assignment operators work in C. I was used to
expression languages for years before the original K&R came out,
and I had already internalized how cascading assignments work. At
some point I did read the syntax rules in C for assignment
operators, but I didn't really need them, because by that time it
already felt natural to me that assignment proceeds right-to-left.
And that has to be true for compound assignment operators as well
as simple assignment, because compound assignment is simply a
syntactic sugaring (with a small semantic adjustment) over the
usual kind of assignment. Until I saw Michael's message it never
would have occurred to me that someone (especially someone with his
level of experience, which obviously is considerable) would find it
confusing.

Re: How About Disallowing Assignments In Expressions?

<86o7chzue6.fsf@linuxsc.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34732&group=comp.lang.c#34732

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17687@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 15 Feb 2024 06:14:57 -0800
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <86o7chzue6.fsf@linuxsc.com>
References: <uq3s76$28dsr$1@dont-email.me> <uq4nmb$2hive$6@dont-email.me> <87r0hlef8q.fsf@nosuchdomain.example.com> <uq6nha$2spqe$3@dont-email.me> <87sf20o4e2.fsf@bsb.me.uk> <uq86e9$37s7s$1@dont-email.me> <uq93m2$3g3f$2@dont-email.me> <8734tzoli4.fsf@bsb.me.uk> <uq979e$40n1$1@dont-email.me> <87v86vbx6s.fsf@nosuchdomain.example.com> <uq98lm$40n1$6@dont-email.me> <87il2vbvza.fsf@nosuchdomain.example.com> <uqau5o$11nm8$1@dont-email.me> <uqauo4$11vps$1@dont-email.me> <uqbrjo$16jcf$6@dont-email.me> <uqg3m0$258lu$5@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="d6a0776853173adee93a90f6ecdad10b";
logging-data="3514852"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++V5AsPAzykBPA3kecKVWRdlqsv8CdJ+E="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:qaRskQpXmJyQa2Xu4AKzbuZHIT8=
sha1:PyMS6PNDXuMq6CItO7p4eJw81sg=
 by: Tim Rentsch - Thu, 15 Feb 2024 14:14 UTC

Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:

> On 12.02.2024 02:17, Lawrence D'Oliveiro wrote:
>
>> You seem to be saying that something like
>>
>> bool a = b == c;
>>
>> should not be allowed.
>
> I have the habit to write such specific expressions with parenthesis
>
> a = (b == c);
>
> for own convenience or better maintainability. (Just BTW.)

My practice is to avoid redundant parentheses. If it's important
to emphasize the precedence relationships, in most cases I would
do that something like this:

a = b == c;

I find using spacing in such cases to be a better impedance match
to human eye hardware than using redundant parentheses.

Re: Building Code Again

<ePpzN.357617$c3Ea.27488@fx10.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34733&group=comp.lang.c#34733

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!paganini.bofh.team!2.eu.feeder.erje.net!feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx10.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Building Code Again
Newsgroups: comp.lang.c
References: <uq3s76$28dsr$1@dont-email.me> <uqhtvp$2ilrc$1@dont-email.me> <uqi1f2$2j7mt$1@dont-email.me> <uqi3k1$2jhr8$1@dont-email.me> <uqi886$2kcqi$1@dont-email.me> <20240214141410.00005ea0@yahoo.com> <uqii13$2m36v$1@dont-email.me> <3v5zN.88071$GX69.76625@fx46.iad> <uqirrb$2o09g$1@dont-email.me> <Sa7zN.358881$xHn7.264957@fx14.iad> <uqj4ml$2pnqa$1@dont-email.me> <uqj6iv$2q00f$1@dont-email.me> <uqj9nj$2ql12$1@dont-email.me> <3yazN.324761$Wp_8.75995@fx17.iad> <uqjo4k$2t0ca$1@dont-email.me>
Lines: 9
Message-ID: <ePpzN.357617$c3Ea.27488@fx10.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 15 Feb 2024 15:10:02 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 15 Feb 2024 15:10:02 GMT
X-Received-Bytes: 1349
 by: Scott Lurndal - Thu, 15 Feb 2024 15:10 UTC

bart <bc@freeuk.com> writes:
>On 14/02/2024 21:47, Scott Lurndal wrote:

>> I've never read so many complaints from one person.
>
>Here's a challenge: give me a reason not to complain.

Life is short and there are far better ways to spend
one's time.

Re: How About Disallowing Assignments In Expressions?

<2UpzN.357618$c3Ea.52829@fx10.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34734&group=comp.lang.c#34734

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!newsfeed.endofthelinebbs.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx10.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: How About Disallowing Assignments In Expressions?
Newsgroups: comp.lang.c
References: <uq3s76$28dsr$1@dont-email.me> <8734tzoli4.fsf@bsb.me.uk> <uq979e$40n1$1@dont-email.me> <87v86vbx6s.fsf@nosuchdomain.example.com> <uq98lm$40n1$6@dont-email.me> <87il2vbvza.fsf@nosuchdomain.example.com> <uqau5o$11nm8$1@dont-email.me> <uqauo4$11vps$1@dont-email.me> <uqg3dk$258lu$4@dont-email.me> <uqg4f3$25dn5$1@dont-email.me> <uqgutd$2a91g$1@dont-email.me> <uqhule$2ilrc$2@dont-email.me> <uqibhb$2kut0$1@dont-email.me> <uqiinc$2m4rb$1@dont-email.me> <uqkj2i$379pl$6@dont-email.me>
Lines: 13
Message-ID: <2UpzN.357618$c3Ea.52829@fx10.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 15 Feb 2024 15:15:10 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 15 Feb 2024 15:15:10 GMT
X-Received-Bytes: 1598
 by: Scott Lurndal - Thu, 15 Feb 2024 15:15 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>On Wed, 14 Feb 2024 15:29:00 +0100, David Brown wrote:
>
>
>The UCSD p-system pioneered the concept of “write once, run anywhere”, by
>defining a standardized p-code interpreter that could be implemented
>across a whole range of different processor architectures. Once you had
>done that, plus some basic OS routines, the main part of the software,
>written in Pascal, should port straight across.

I used UCSD pascal on a Terek box in 1979. And haven't even seen
a reference to UCSD pascal since.

Re: How About Disallowing Assignments In Expressions?

<aVpzN.357619$c3Ea.195092@fx10.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34735&group=comp.lang.c#34735

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx10.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: How About Disallowing Assignments In Expressions?
Newsgroups: comp.lang.c
References: <uq3s76$28dsr$1@dont-email.me> <87r0hlef8q.fsf@nosuchdomain.example.com> <uq6nha$2spqe$3@dont-email.me> <87sf20o4e2.fsf@bsb.me.uk> <uq86e9$37s7s$1@dont-email.me> <uq93m2$3g3f$2@dont-email.me> <8734tzoli4.fsf@bsb.me.uk> <uq979e$40n1$1@dont-email.me> <87v86vbx6s.fsf@nosuchdomain.example.com> <uq98lm$40n1$6@dont-email.me> <87il2vbvza.fsf@nosuchdomain.example.com> <uqau5o$11nm8$1@dont-email.me> <uqauo4$11vps$1@dont-email.me> <uqg3dk$258lu$4@dont-email.me> <uqkj5c$379pl$7@dont-email.me>
Lines: 9
Message-ID: <aVpzN.357619$c3Ea.195092@fx10.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 15 Feb 2024 15:16:22 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 15 Feb 2024 15:16:22 GMT
X-Received-Bytes: 1483
 by: Scott Lurndal - Thu, 15 Feb 2024 15:16 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>On Tue, 13 Feb 2024 16:55:32 +0100, Janis Papanagnou wrote:
>
>> You are mistaken; C++ had no 'bool' type initially. It had been added
>> later.
>
>The first version of the C++ standard was C++98, and that had bool in it.

The first version of C++ was in the mid-80s and didn't have bool (c.f. cfront).

Re: Building Code Again

<uqlb13$3c78i$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34736&group=comp.lang.c#34736

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: Building Code Again
Date: Thu, 15 Feb 2024 15:36:03 +0000
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <uqlb13$3c78i$1@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uqhtvp$2ilrc$1@dont-email.me>
<uqi1f2$2j7mt$1@dont-email.me> <uqi3k1$2jhr8$1@dont-email.me>
<uqi886$2kcqi$1@dont-email.me> <20240214141410.00005ea0@yahoo.com>
<uqii13$2m36v$1@dont-email.me> <3v5zN.88071$GX69.76625@fx46.iad>
<uqirrb$2o09g$1@dont-email.me> <Sa7zN.358881$xHn7.264957@fx14.iad>
<uqj4ml$2pnqa$1@dont-email.me> <uqj6iv$2q00f$1@dont-email.me>
<uqj9nj$2ql12$1@dont-email.me> <3yazN.324761$Wp_8.75995@fx17.iad>
<uqjo4k$2t0ca$1@dont-email.me> <ePpzN.357617$c3Ea.27488@fx10.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 15 Feb 2024 15:36:03 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="02d8ac7ffc12f179390259c847a21c25";
logging-data="3546386"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18J9GClazbZGe31VitkSxapczuAJP72JVg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:bBki27F4RdRqDw5ucpbVC2z0SGg=
Content-Language: en-GB
In-Reply-To: <ePpzN.357617$c3Ea.27488@fx10.iad>
 by: bart - Thu, 15 Feb 2024 15:36 UTC

On 15/02/2024 15:10, Scott Lurndal wrote:
> bart <bc@freeuk.com> writes:
>> On 14/02/2024 21:47, Scott Lurndal wrote:
>
>>> I've never read so many complaints from one person.
>>
>> Here's a challenge: give me a reason not to complain.
>
> Life is short and there are far better ways to spend
> one's time.

You've expressed my thoughts exactly. Why should I waste /my/ grappling
with someone else's mess of a build process?

They invent loads of UNNECESSARY extra hoops to jump through, and expect
everyone else, even those using different systems that don't even have
those hoops, to do the same.

You suggested netpbm to avoid reinventing wheels. Sure, if you can
actually access the wheels and get them to turn!

I take it however that you would never waste your time overhauling any
process, any product, to make it smaller, tidier, nippier and generally
more aesthetic?

There is no satisfaction in producing something to be proud of,
something elegant, instead of taking a big mess of a distribution,
cramming it into box and scrawling 'makefile' on the side?

Re: How About Disallowing Assignments In Expressions?

<87y1blk9id.fsf@bsb.me.uk>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34737&group=comp.lang.c#34737

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.usenet@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 15 Feb 2024 15:55:06 +0000
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <87y1blk9id.fsf@bsb.me.uk>
References: <uq3s76$28dsr$1@dont-email.me> <uq4nmb$2hive$6@dont-email.me>
<87r0hlef8q.fsf@nosuchdomain.example.com>
<uq6nha$2spqe$3@dont-email.me> <87sf20o4e2.fsf@bsb.me.uk>
<uq86e9$37s7s$1@dont-email.me> <uq93m2$3g3f$2@dont-email.me>
<8734tzoli4.fsf@bsb.me.uk> <uq979e$40n1$1@dont-email.me>
<87v86vbx6s.fsf@nosuchdomain.example.com>
<uq98lm$40n1$6@dont-email.me>
<87il2vbvza.fsf@nosuchdomain.example.com>
<uq9m1n$bfj9$1@dont-email.me>
<87eddjblyh.fsf@nosuchdomain.example.com>
<uqbrgt$16jcf$5@dont-email.me>
<87bk8m9xzw.fsf@nosuchdomain.example.com>
<uqc4dc$1bn4b$1@dont-email.me> <uqcv3o$1fikf$1@dont-email.me>
<uqjc8o$2r2ac$3@dont-email.me>
<87sf1u8yeu.fsf@nosuchdomain.example.com>
<uqkir4$379pl$5@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="931a685d1a0507fd0c1b29737a537180";
logging-data="3549700"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HLFf4L2EMofrW0aOuuoPvnZu2N+gmR4Q="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:xHdkEkJqP49yHlcuWGMkfkypLGk=
sha1:0uYT3SsH0jYNHJjJ+e7YHbVGFwk=
X-BSB-Auth: 1.95ee0b2d9354a24329a2.20240215155506GMT.87y1blk9id.fsf@bsb.me.uk
 by: Ben Bacarisse - Thu, 15 Feb 2024 15:55 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:

> On Wed, 14 Feb 2024 14:38:01 -0800, Keith Thompson wrote:
>
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>
>>> And yet, all the examples posted so far have involved, not the actual
>>> types, but pointers to them.
>>
>> Because pointers to incompatible types are a good way to demonstrate
>> incompatibility.
>
> But it was those types I was talking about, not pointers to them.

You seem to be arguing just for the sake it now since you pointedly
refuse to answer Keith's question:

"Do you understand that int and long are incompatible even though
they're implicitly convertible, even if they happen to have the same
size and representation?"

--
Ben.

Re: How About Disallowing Assignments In Expressions?

<877cj58zhe.fsf@nosuchdomain.example.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34738&group=comp.lang.c#34738

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 15 Feb 2024 08:27:09 -0800
Organization: None to speak of
Lines: 20
Message-ID: <877cj58zhe.fsf@nosuchdomain.example.com>
References: <uq3s76$28dsr$1@dont-email.me> <uq4nmb$2hive$6@dont-email.me>
<87r0hlef8q.fsf@nosuchdomain.example.com>
<uq6nha$2spqe$3@dont-email.me> <87sf20o4e2.fsf@bsb.me.uk>
<uq86e9$37s7s$1@dont-email.me> <uq93m2$3g3f$2@dont-email.me>
<8734tzoli4.fsf@bsb.me.uk> <uq979e$40n1$1@dont-email.me>
<87v86vbx6s.fsf@nosuchdomain.example.com>
<uq98lm$40n1$6@dont-email.me>
<87il2vbvza.fsf@nosuchdomain.example.com>
<uq9m1n$bfj9$1@dont-email.me>
<87eddjblyh.fsf@nosuchdomain.example.com>
<uqbrgt$16jcf$5@dont-email.me>
<87bk8m9xzw.fsf@nosuchdomain.example.com>
<uqc4dc$1bn4b$1@dont-email.me> <uqcv3o$1fikf$1@dont-email.me>
<uqjc8o$2r2ac$3@dont-email.me>
<87sf1u8yeu.fsf@nosuchdomain.example.com>
<uqkir4$379pl$5@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="e5c98b55bbe910135c5e6009c29bfdcf";
logging-data="3554934"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PxBrLmS/WdJmsNsec1bin"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:r3b8ZlFMuBvP469JPM7niJolAuk=
sha1:xDO+GCT3saSz/bVznXPEUH2yug4=
 by: Keith Thompson - Thu, 15 Feb 2024 16:27 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> On Wed, 14 Feb 2024 14:38:01 -0800, Keith Thompson wrote:
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>> And yet, all the examples posted so far have involved, not the actual
>>> types, but pointers to them.
>>
>> Because pointers to incompatible types are a good way to demonstrate
>> incompatibility.
>
> But it was those types I was talking about, not pointers to them.

I'll assume either that you understand type compatibility, or you don't
care.

If that's not the case and you have questions, feel free to ask.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

Re: Building Code Again

<20240215083205.613@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34739&group=comp.lang.c#34739

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-6894@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: Building Code Again
Date: Thu, 15 Feb 2024 16:40:19 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <20240215083205.613@kylheku.com>
References: <uq3s76$28dsr$1@dont-email.me>
<877cj8axo6.fsf@nosuchdomain.example.com> <uqgs2c$29nvr$1@dont-email.me>
<uqhtvp$2ilrc$1@dont-email.me> <uqi1f2$2j7mt$1@dont-email.me>
<uqi3k1$2jhr8$1@dont-email.me> <uqi886$2kcqi$1@dont-email.me>
<20240214141410.00005ea0@yahoo.com> <uqii13$2m36v$1@dont-email.me>
<3v5zN.88071$GX69.76625@fx46.iad> <uqirrb$2o09g$1@dont-email.me>
<Sa7zN.358881$xHn7.264957@fx14.iad> <uqj4ml$2pnqa$1@dont-email.me>
<uqj6iv$2q00f$1@dont-email.me> <uqj9nj$2ql12$1@dont-email.me>
<3yazN.324761$Wp_8.75995@fx17.iad> <uqjo4k$2t0ca$1@dont-email.me>
<20240214190516.111@kylheku.com> <uqktfq$39qk3$1@dont-email.me>
Injection-Date: Thu, 15 Feb 2024 16:40:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d76b38c2db4f8cfca664aab4bddb4800";
logging-data="3566196"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18SI4uSe12KA8TGKsuG+ZkqI32YD//IMbU="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:iqiwCDPh3QnauFIvTXDWMxkj+tQ=
 by: Kaz Kylheku - Thu, 15 Feb 2024 16:40 UTC

On 2024-02-15, bart <bc@freeuk.com> wrote:
> On 15/02/2024 03:08, Kaz Kylheku wrote:
>> On 2024-02-15, bart <bc@freeuk.com> wrote:
>>> There appears to be nobody in Unix who questions such things; everyone
>>> takes takes at face value. So long as it eventually produces a result,
>>> no matter how long it takes or how torturous the process, nobody cares.
>>
>> This is false. There are many critics "in Unix", of Makefiles, GNU
>> Autotools, the C language including its preprocessing, the shell
>> language, various utilities, POSIX API's, and almost imaginable element
>> of the whole cornucopia. Many are well-informed, experienced and have
>> well-reasoned opinions.
>>
>
> And yet I still can't trivially compile pnminvert.c into pnminvert.exe
> using just a C compiler.

Unsurprisingly, the existence of critics in the C and Unix world
doesn't magically fix an obscure netpbm build problem.

> make[2]: Leaving directory '/mnt/c/xxx/netpbm-10.86.40/lib/util'
> cc -shared -Wl,--image-base=0x10000000 -Wl,--enable-auto-import

Looks like the linker doesn't understand the --image-base option.

That option exists somewhere for some good reason.

I can't imagine why something like netpbm would need exotic linker
options, but there is probably some reason it was introduced.

I have this in the man page for ld:

--image-base value
Use value as the base address of your program or dll. This
is the lowest memory location that will be used when your
program or dll is loaded. To reduce the need to relocate
and improve performance of your dlls, each should have a
unique base address and not overlap any other dlls. The
default is 0x400000 for executables, and 0x10000000 for
dlls. [This option is specific to the i386 PE targeted
port of the linker]

It looks like stray cruft to me, and the value they are using is
the documented default one anyway.

It would be more productive to take this up with the netpbm project
than the comp.lang.c newsgroup.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: How About Disallowing Assignments In Expressions?

<uqlerj$3crk6$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34740&group=comp.lang.c#34740

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.bbs.nz!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: malcolm.arthur.mclean@gmail.com (Malcolm McLean)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 15 Feb 2024 16:41:23 +0000
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <uqlerj$3crk6$1@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uq86e9$37s7s$1@dont-email.me>
<uq93m2$3g3f$2@dont-email.me> <8734tzoli4.fsf@bsb.me.uk>
<uq979e$40n1$1@dont-email.me> <87v86vbx6s.fsf@nosuchdomain.example.com>
<uq98lm$40n1$6@dont-email.me> <87il2vbvza.fsf@nosuchdomain.example.com>
<uqau5o$11nm8$1@dont-email.me> <uqauo4$11vps$1@dont-email.me>
<uqbrjo$16jcf$6@dont-email.me> <uqg3m0$258lu$5@dont-email.me>
<uqgpd1$29928$3@dont-email.me> <87il2s9fdj.fsf@nosuchdomain.example.com>
<uqj95e$2qhb1$1@dont-email.me> <sEazN.324764$Wp_8.34532@fx17.iad>
<86wmr6z0zg.fsf@linuxsc.com> <uql32m$3apfo$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 15 Feb 2024 16:41:23 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="48156951d350291154a44925d30c4355";
logging-data="3567238"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/qS5MW/Z1NF9WtyBdmgAKjMLInC35a+Qc="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:1gtpeNfY247tb6k+g0cfvucyIzs=
Content-Language: en-GB
In-Reply-To: <uql32m$3apfo$1@dont-email.me>
 by: Malcolm McLean - Thu, 15 Feb 2024 16:41 UTC

On 15/02/2024 13:20, David Brown wrote:
> On 15/02/2024 07:37, Tim Rentsch wrote:
>> scott@slp53.sl.home (Scott Lurndal) writes:
>>
>>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>>
>>>> On Tue, 13 Feb 2024 14:19:20 -0800, Keith Thompson wrote:
>>>>
>>>>> But C has a *lot* of precedence levels, and they're not all
>>>>> obvious.
>>>>>
>>>>> If I see `a | b ^ c`, I'm not likely to remember off the top of my
>>>>> head ...
>>>>
>>>> So don't remember off the top of your head, [just] keep the docs
>>>> handy.  That's what I do.
>>>
>>> Why?  The code is easier to read and maintain if the precedence is
>>> made explicit.
>>
>> Every serious C developer should know all the operator precedence
>> relationships without having to look them up.
>>
>
> <https://en.wikipedia.org/wiki/No_true_Scotsman>
>
> /Serious/ developers write code that is as clear as they can.  They know
> where references are for when they need them, but do not waste cognitive
> effort memorising things that are better expressed in a different way
> (such as by using parentheses or breaking expressions into parts).
>

I can't remember the precedence relationships beyond a few very
conventional and well known ones. I don't see that as a strength. But it
does mean that I am forced to use parentheses where it might not be
strictly necessary.

--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

Re: How About Disallowing Assignments In Expressions?

<uqlf6g$3crk6$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34741&group=comp.lang.c#34741

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: malcolm.arthur.mclean@gmail.com (Malcolm McLean)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 15 Feb 2024 16:47:12 +0000
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <uqlf6g$3crk6$2@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uq86e9$37s7s$1@dont-email.me>
<uq93m2$3g3f$2@dont-email.me> <8734tzoli4.fsf@bsb.me.uk>
<uq979e$40n1$1@dont-email.me> <87v86vbx6s.fsf@nosuchdomain.example.com>
<uq98lm$40n1$6@dont-email.me> <87il2vbvza.fsf@nosuchdomain.example.com>
<uqau5o$11nm8$1@dont-email.me> <uqauo4$11vps$1@dont-email.me>
<uqbrjo$16jcf$6@dont-email.me> <uqg3m0$258lu$5@dont-email.me>
<uqgpd1$29928$3@dont-email.me> <87il2s9fdj.fsf@nosuchdomain.example.com>
<uqj95e$2qhb1$1@dont-email.me> <sEazN.324764$Wp_8.34532@fx17.iad>
<uqkjp1$379pl$11@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 15 Feb 2024 16:47:12 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="48156951d350291154a44925d30c4355";
logging-data="3567238"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/kP0xgyvThoc7fDcK6/nV+unnIj4XR+10="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ZPg6QuJaQzA7uVKQCb9IwZZg2M0=
Content-Language: en-GB
In-Reply-To: <uqkjp1$379pl$11@dont-email.me>
 by: Malcolm McLean - Thu, 15 Feb 2024 16:47 UTC

On 15/02/2024 08:59, Lawrence D'Oliveiro wrote:
> On Wed, 14 Feb 2024 21:54:32 GMT, Scott Lurndal wrote:
>
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>
>>> On Tue, 13 Feb 2024 14:19:20 -0800, Keith Thompson wrote:
>>>
>>>> But C has a *lot* of precedence levels, and they're not all obvious.
>>>>
>>>> If I see `a | b ^ c`, I'm not likely to remember off the top of my
>>>> head ...
>>>
>>> So don’t remember “off the top of your head”: keep the docs handy.
>>> That’s what I do.
>>
>> Why? The code is easier to read and maintain if the precedence is made
>> explicit.
>
> You’re assuming that the parenthesis clutter has negligible effect on
> readability. That may be OK with one or two extraneous pairs, but typical
> C code tends to end up with a lot more than that.
>
That is an issue. It's hard to match parentheses in long expressions. On
the other hand odd spacing can also make text harder to read. Then if
parentheses are also used for casts, or in C++ for access functions,
that can also add to the overall burden.
--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

Re: How About Disallowing Assignments In Expressions?

<TArzN.227131$yEgf.7349@fx09.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34742&group=comp.lang.c#34742

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!newsfeed.endofthelinebbs.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx09.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: How About Disallowing Assignments In Expressions?
Newsgroups: comp.lang.c
References: <uq3s76$28dsr$1@dont-email.me> <87v86vbx6s.fsf@nosuchdomain.example.com> <uq98lm$40n1$6@dont-email.me> <87il2vbvza.fsf@nosuchdomain.example.com> <uqau5o$11nm8$1@dont-email.me> <uqauo4$11vps$1@dont-email.me> <uqbrjo$16jcf$6@dont-email.me> <uqg3m0$258lu$5@dont-email.me> <uqgpd1$29928$3@dont-email.me> <87il2s9fdj.fsf@nosuchdomain.example.com> <uqj95e$2qhb1$1@dont-email.me> <sEazN.324764$Wp_8.34532@fx17.iad> <uqkjp1$379pl$11@dont-email.me> <uqlf6g$3crk6$2@dont-email.me>
Lines: 27
Message-ID: <TArzN.227131$yEgf.7349@fx09.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 15 Feb 2024 17:11:15 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 15 Feb 2024 17:11:15 GMT
X-Received-Bytes: 2126
 by: Scott Lurndal - Thu, 15 Feb 2024 17:11 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>On 15/02/2024 08:59, Lawrence D'Oliveiro wrote:
>> On Wed, 14 Feb 2024 21:54:32 GMT, Scott Lurndal wrote:
>>
>>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>>
>>>> On Tue, 13 Feb 2024 14:19:20 -0800, Keith Thompson wrote:
>>>>
>>>>> But C has a *lot* of precedence levels, and they're not all obvious.
>>>>>
>>>>> If I see `a | b ^ c`, I'm not likely to remember off the top of my
>>>>> head ...
>>>>
>>>> So don’t remember “off the top of your head”: keep the docs handy.
>>>> That’s what I do.
>>>
>>> Why? The code is easier to read and maintain if the precedence is made
>>> explicit.
>>
>> You’re assuming that the parenthesis clutter has negligible effect on
>> readability. That may be OK with one or two extraneous pairs, but typical
>> C code tends to end up with a lot more than that.
> >
>That is an issue. It's hard to match parentheses in long expressions.

Not if you're using an editor like vim, which highlights the matching
paranthesis/brace/bracket automatically, if configured to do so.

Re: How About Disallowing Assignments In Expressions?

<20240215092230.374@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=34743&group=comp.lang.c#34743

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-6894@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 15 Feb 2024 17:27:52 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <20240215092230.374@kylheku.com>
References: <uq3s76$28dsr$1@dont-email.me> <uq6nha$2spqe$3@dont-email.me>
<87sf20o4e2.fsf@bsb.me.uk> <uq86e9$37s7s$1@dont-email.me>
<uq93m2$3g3f$2@dont-email.me> <8734tzoli4.fsf@bsb.me.uk>
<uq979e$40n1$1@dont-email.me> <87v86vbx6s.fsf@nosuchdomain.example.com>
<uq98lm$40n1$6@dont-email.me> <87il2vbvza.fsf@nosuchdomain.example.com>
<uqau5o$11nm8$1@dont-email.me> <uqauo4$11vps$1@dont-email.me>
<uqb1vc$12k3v$1@dont-email.me> <uqd039$1fnp7$1@dont-email.me>
<uqduum$1mm6v$1@dont-email.me> <uqf801$20hb9$1@dont-email.me>
<uqfd4d$21bu6$1@dont-email.me> <uqfgnv$21tva$1@dont-email.me>
<uqfngh$235bb$1@dont-email.me> <uqft7s$2458n$1@dont-email.me>
<uqg1bv$24to4$1@dont-email.me> <877cj8axo6.fsf@nosuchdomain.example.com>
<uqgs2c$29nvr$1@dont-email.me> <uqhtvp$2ilrc$1@dont-email.me>
<uqi1f2$2j7mt$1@dont-email.me> <uqi3k1$2jhr8$1@dont-email.me>
<uqi5gs$2jtp3$1@dont-email.me> <uqibtl$2l0v9$1@dont-email.me>
<uqke4u$36p8j$1@dont-email.me> <uqkja3$379pl$8@dont-email.me>
Injection-Date: Thu, 15 Feb 2024 17:27:52 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d76b38c2db4f8cfca664aab4bddb4800";
logging-data="3581771"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+P8DxreSQIZXGjKI7Qwa7ZJSAA+M7fkTs="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:62KqJzxmclGAP+uGMdB3PzNaAsI=
 by: Kaz Kylheku - Thu, 15 Feb 2024 17:27 UTC

On 2024-02-15, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> On Thu, 15 Feb 2024 08:23:09 +0100, Janis Papanagnou wrote:
>
>> It's worth to add Awk to your list of script languages, since it's
>> standard on Unix, and its syntax largely resembles the syntax of C.
>
> Perl does everything Awk can do, and do it just as concisely

Nope! E.g. remove duplicate lines:

awk '!s[$0]++'

Perl requires a clump of options to get into an Awk-style loop, and
requires $ sigils on all variables. The positional fields are accessed
in some F array, rather than $1, $2.

Do you now the following famous quote from Larry Wall?
Something along the lines, 'I still say "awk { print $1 }" a lot'.

> , and it can
> do more besides.

GNU Awk can be extended with C, so you can do just about anything, in
theory. It's not easy though. The language has a lot of shortcomings,
like not being able to return an array from a function, or use [] indexing
on strings, and having to represent local variables as exta unused
parameters.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca


devel / comp.lang.c / Re: How About Disallowing Assignments In Expressions?

Pages:123456789101112131415161718192021
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor