Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"It is easier to fight for principles than to live up to them." -- Alfred Adler


devel / comp.lang.c / iso646.h

SubjectAuthor
* iso646.hLawrence D'Oliveiro
+- Re: iso646.hLew Pitcher
+* Re: iso646.hJames Kuyper
|`- Re: iso646.hLawrence D'Oliveiro
`* Re: iso646.hDavid Brown
 +* Re: iso646.hScott Lurndal
 |`* Re: iso646.hLawrence D'Oliveiro
 | `* Re: iso646.hKeith Thompson
 |  `* Re: iso646.hLawrence D'Oliveiro
 |   `* Re: iso646.hKeith Thompson
 |    `* Re: iso646.hLawrence D'Oliveiro
 |     `- Re: iso646.hKaz Kylheku
 `* Re: iso646.hLawrence D'Oliveiro
  +- Re: iso646.hKaz Kylheku
  +* Re: iso646.hBlue-Maned_Hawk
  |`* Re: iso646.hLawrence D'Oliveiro
  | +- Re: iso646.hKaz Kylheku
  | `* Re: iso646.hJanis Papanagnou
  |  `* Re: iso646.hLawrence D'Oliveiro
  |   +- Re: iso646.hJanis Papanagnou
  |   `- Re: iso646.hKaz Kylheku
  +- Re: iso646.hTim Rentsch
  +* Re: iso646.hJanis Papanagnou
  |`* Re: iso646.hLawrence D'Oliveiro
  | `- Re: iso646.hJanis Papanagnou
  +* Re: iso646.hDavid Brown
  |`* Re: iso646.hKaz Kylheku
  | +- Re: iso646.hbart
  | +* Re: iso646.hJanis Papanagnou
  | |+* Re: iso646.hKeith Thompson
  | ||`* Re: iso646.hLawrence D'Oliveiro
  | || +* Re: iso646.hKeith Thompson
  | || |`* Re: iso646.hDavid Brown
  | || | `- Re: iso646.hJanis Papanagnou
  | || +* Re: iso646.hLew Pitcher
  | || |`* Re: iso646.hLawrence D'Oliveiro
  | || | +- Re: iso646.hLew Pitcher
  | || | +* Re: iso646.hKaz Kylheku
  | || | |`- Re: iso646.hChris M. Thomasson
  | || | `- Re: iso646.hScott Lurndal
  | || `- Re: iso646.hKaz Kylheku
  | |`* Re: iso646.hKaz Kylheku
  | | +- Re: iso646.hJanis Papanagnou
  | | `* Re: iso646.hJanis Papanagnou
  | |  `- Re: iso646.hKaz Kylheku
  | `- Re: iso646.hDavid Brown
  +- Re: iso646.hbart
  `* Re: iso646.hMalcolm McLean
   +* Re: iso646.hLew Pitcher
   |+- Re: iso646.hKaz Kylheku
   |+* Re: iso646.hLawrence D'Oliveiro
   ||+* Re: iso646.hKeith Thompson
   |||`* Re: iso646.hLawrence D'Oliveiro
   ||| +* Re: iso646.hKeith Thompson
   ||| |+- Re: iso646.hLawrence D'Oliveiro
   ||| |`- Re: iso646.hMalcolm McLean
   ||| `- Re: iso646.hJanis Papanagnou
   ||`- Re: iso646.hJanis Papanagnou
   |`* C/CPP macro conventions (was Re: iso646.h)Janis Papanagnou
   | `* Re: C/CPP macro conventions (was Re: iso646.h)Kaz Kylheku
   |  +- Re: C/CPP macro conventions (was Re: iso646.h)Janis Papanagnou
   |  +- Re: C/CPP macro conventions (was Re: iso646.h)David Brown
   |  `- Re: C/CPP macro conventions (was Re: iso646.h)Blue-Maned_Hawk
   +* Re: iso646.hbart
   |+* Re: iso646.hScott Lurndal
   ||`* Re: iso646.hJames Kuyper
   || +* Re: iso646.hKalevi Kolttonen
   || |+* Re: iso646.hLawrence D'Oliveiro
   || ||`* Re: iso646.hKaz Kylheku
   || || +* Re: iso646.hKalevi Kolttonen
   || || |`* Re: iso646.hJanis Papanagnou
   || || | `* Re: iso646.hJames Kuyper
   || || |  +* Re: iso646.hJanis Papanagnou
   || || |  |+- Re: iso646.hJanis Papanagnou
   || || |  |+* Re: iso646.hKalevi Kolttonen
   || || |  ||`* Re: iso646.hKalevi Kolttonen
   || || |  || `* Re: iso646.hLawrence D'Oliveiro
   || || |  ||  `- Re: iso646.hDavid Brown
   || || |  |`* Re: iso646.hKeith Thompson
   || || |  | `- Re: iso646.hKalevi Kolttonen
   || || |  +- Re: iso646.hLawrence D'Oliveiro
   || || |  `* Re: iso646.hKaz Kylheku
   || || |   `* Re: iso646.hJames Kuyper
   || || |    +* Re: iso646.hDavid Brown
   || || |    |+* Re: iso646.hJanis Papanagnou
   || || |    ||`* Re: iso646.hDavid Brown
   || || |    || `- Re: iso646.hJanis Papanagnou
   || || |    |`* Re: iso646.hbart
   || || |    | `- Re: iso646.hDavid Brown
   || || |    `- Re: iso646.hTim Rentsch
   || || `- Re: iso646.hJanis Papanagnou
   || |`- Unix shell conditionals (was Re: iso646.h)Janis Papanagnou
   || `* Re: iso646.hScott Lurndal
   ||  +* Re: iso646.hKaz Kylheku
   ||  |`* Re: iso646.hbart
   ||  | `- Re: iso646.hKaz Kylheku
   ||  +- Re: iso646.hKeith Thompson
   ||  `* Re: iso646.hJames Kuyper
   ||   `- Re: iso646.hJanis Papanagnou
   |+* Python (Re: iso646.h)Kalevi Kolttonen
   ||+* Re: Python (Re: iso646.h)bart
   ||+* Re: Python (Re: iso646.h)Keith Thompson
   ||+* Re: Python (Re: iso646.h)Lawrence D'Oliveiro
   ||`- Re: Python (Re: iso646.h)Dan Cross
   |+* Re: iso646.hKeith Thompson
   |`* Re: iso646.hMalcolm McLean
   `* Re: iso646.hLawrence D'Oliveiro

Pages:1234567891011121314151617181920212223242526
Re: Functional Programming (was Re: iso646.h)

<up7p0t$csr3$1@dont-email.me>

  copy mid

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

  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.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Functional Programming (was Re: iso646.h)
Date: Mon, 29 Jan 2024 09:52:45 +0100
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <up7p0t$csr3$1@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uol92t$l82b$3@dont-email.me>
<uomjfr$sopf$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me>
<uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me> <87frym7l3p.fsf@nosuchdomain.example.com>
<uot08a$278i2$1@dont-email.me> <uotmed$2ack6$2@dont-email.me>
<uoto3n$2an28$1@dont-email.me> <uou05d$2bvjr$2@dont-email.me>
<uou170$2c7ed$1@dont-email.me> <uouf96$2em2l$2@dont-email.me>
<uov1f5$2heei$1@dont-email.me> <up0l1l$2u6hl$1@dont-email.me>
<up0qad$2v1n8$1@dont-email.me> <up1l5p$337rb$1@dont-email.me>
<up38cs$3ec59$2@dont-email.me> <up3q8k$3hbk7$6@dont-email.me>
<up5e54$3t99q$2@dont-email.me> <up6e34$2vq9$6@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 29 Jan 2024 08:52:45 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="97a86bc186f2ce7a3f5aa28c9d36f604";
logging-data="422755"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+uvGaQwuCO9WKarGMVl0YyW76iLHTbwfQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:Gq+LO1N3hIPXmdw99nVPJSbjHYM=
Content-Language: en-GB
In-Reply-To: <up6e34$2vq9$6@dont-email.me>
 by: David Brown - Mon, 29 Jan 2024 08:52 UTC

On 28/01/2024 21:40, Lawrence D'Oliveiro wrote:
> On Sun, 28 Jan 2024 12:35:00 +0100, David Brown wrote:
>
>> On 27/01/2024 21:49, Lawrence D'Oliveiro wrote:
>>
>>> The dirty little secret of pure-functional programming is that I/O
>>> cannot be treated in a purely functional fashion.
>>
>> It can - you just have to have the IO world as an input and an output to
>> your function.
>
> You mean, carry around multiple copies of the entire Universe in
> individual variables?

No, you only need one copy at a time :-) And you only actually need a
bit of the universe, covering your input and output streams.

Another option is that your code does not actually do any IO, but
returns a function that can be applied to the world to give the results
you want.

Real functional programming languages have smarter ways of doing this in
an efficient way. The functions may be pure as you see them in code,
but the generated results do IO just like any other generated code in
other languages. This gives you the advantages of purity at the source
level - it's far easier to have mathematical proofs of the code's
correctness, multi-threading or asynchronous coding is easy because you
have no state, therefore no shared state, therefore no race conditions.
But the end result is efficient - perhaps not "well-written C"
efficient, but close enough to be of practical use in the real world.
The key challenge is that you have to understand monads!

A much simpler idea in a similar vein is that functional programming
languages don't have iterative loops - you use lists or recursion to
express repetition. In C, having a recursive function that works
through a linked list is massively inefficient compared to a for loop,
in both run-time and stack space. In a functional programming language,
lists and recursion make it simple and clear to express the code - and
the compiler turns it all into an iterative loop in the generated code.

(Facebook uses Haskell for their filters and other data handling. You
may not think much about Facebook's algorithms, but it shows that pure
functional programming works fine and efficiently for big IO
applications. Major mobile phone systems are programmed in Erlang,
which is a functional programming language, albeit an impure one which
can "cheat".)

Re: iso646.h

<up861l$f5fj$1@dont-email.me>

  copy mid

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

  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.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 13:35:00 +0100
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <up861l$f5fj$1@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uomjfr$sopf$1@dont-email.me>
<uoopm9$1blvh$1@dont-email.me> <uop0r1$1d4d4$1@dont-email.me>
<uoqvas$1q40p$1@dont-email.me> <uor4rf$1r10t$1@dont-email.me>
<87frym7l3p.fsf@nosuchdomain.example.com> <uot08a$278i2$1@dont-email.me>
<uotmed$2ack6$2@dont-email.me> <up17f9$313qt$4@dont-email.me>
<up197h$31jct$1@dont-email.me> <up1gkb$32k8k$4@dont-email.me>
<up1imc$32upd$1@dont-email.me> <up1j9s$331cv$1@dont-email.me>
<up397j$3ec59$3@dont-email.me> <41btN.183056$yEgf.182064@fx09.iad>
<up3qqr$3hbk7$8@dont-email.me> <up5f80$3t99q$5@dont-email.me>
<up6e8k$2vq9$7@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 29 Jan 2024 12:35:01 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="97a86bc186f2ce7a3f5aa28c9d36f604";
logging-data="497139"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Zxm/bzjsZC5ukCf80epVesTuCCk97YPc="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:p7bgtuiQ7vbhj+JrJ/vp8CnH3Ws=
In-Reply-To: <up6e8k$2vq9$7@dont-email.me>
Content-Language: en-GB
 by: David Brown - Mon, 29 Jan 2024 12:35 UTC

On 28/01/2024 21:43, Lawrence D'Oliveiro wrote:
> On Sun, 28 Jan 2024 12:53:36 +0100, David Brown wrote:
>
>> On 27/01/2024 21:59, Lawrence D'Oliveiro wrote:
>>
>>> On Sat, 27 Jan 2024 17:26:24 GMT, Scott Lurndal wrote:
>>>
>>>> David Brown <david.brown@hesbynett.no> writes:
>>>>>
>>>>> Standard printf formatting also does not allow such re-arrangements.
>>>>>
>>>> Depends on what standard you use. POSIX certainly does.
>>>
>>> C and POSIX go together like a horse and carriage; one without the
>>> other is a lot less useful.
>>
>> To the nearest percent, 0% of all systems running C programs support
>> POSIX (or Windows, or any other "big" system). The world of small
>> embedded systems totally outweigh "big" systems by many orders of
>> magnitude. And perhaps 80% of such small systems are programmed in C.
>
> And a lot of those “embedded” systems are running Android.

No, they are not. Android is Linux, and is included in the 0%.

>
> Android ships as many units per year as the entire installed base of
> Microsoft Windows.

Sure. And it is still within the 0%.

Take your car as an example. There's a reasonable chance, if it is
modern, that the entertainment and navigation system is running Android.
You might have a couple of other parts running embedded Linux of other
types. And you might have 100 other microcontrollers running programs
written in C, but not running a "big" POSIX OS. Some will run RTOS's,
some will be bare metal.

On the computer on your desk, you have a microcontroller in your mouse,
keyboard, webcam, screen, harddisk, managed switch. Your printer might
have some kind of embedded Linux for its display and UI, but probably
has many other microcontrollers in it. Your toaster, oven, fridge,
alarm clock, digital thermometer - microcontrollers are everywhere.

Even your typical Android device - a phone or tablet - will have a few
separate microcontrollers, and a variety of bits and pieces in its SoC
that are programmed in C but do not have a POSIX system.

Re: iso646.h

<up8830$ffni$1@dont-email.me>

  copy mid

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

  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.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 14:09:51 +0100
Organization: A noiseless patient Spider
Lines: 113
Message-ID: <up8830$ffni$1@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uol92t$l82b$3@dont-email.me>
<uomjfr$sopf$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me>
<uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me> <87frym7l3p.fsf@nosuchdomain.example.com>
<uot08a$278i2$1@dont-email.me> <uotmed$2ack6$2@dont-email.me>
<uoto3n$2an28$1@dont-email.me> <uou05d$2bvjr$2@dont-email.me>
<uou170$2c7ed$1@dont-email.me> <uouf96$2em2l$2@dont-email.me>
<uov1f5$2heei$1@dont-email.me> <up0l1l$2u6hl$1@dont-email.me>
<up0qad$2v1n8$1@dont-email.me> <up0vec$2vv0k$1@dont-email.me>
<up188s$31e8n$1@dont-email.me> <up38aj$3ec59$1@dont-email.me>
<up692h$28q6$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 29 Jan 2024 13:09:52 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="97a86bc186f2ce7a3f5aa28c9d36f604";
logging-data="507634"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/YNWLiReHV9ru1oOC08vxJ1ddYdI/U1Sc="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:aV9cj0TqPye4Rfc8QvKgbDQC7ho=
In-Reply-To: <up692h$28q6$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Mon, 29 Jan 2024 13:09 UTC

On 28/01/2024 20:14, Janis Papanagnou wrote:
> On 27.01.2024 16:43, David Brown wrote:
>> On 26/01/2024 22:30, Janis Papanagnou wrote:

>>
>>> That's why somewhat experienced programmers would not write above
>>> code that way; something like "run_tests()" is (typically) or can be
>>> very time consuming, so they'd do
>>> t0 = get_time(); res = run_tests(); t1 = get_time();
>>> cout << ... etc.
>>
>> Of course.
>
> You can serialize (as I suggested previously as one example) or
> embed functions like take_time(run_tests()) as another example.
>
>>
>> In practice, they could still be badly wrong even with that code -
>> there's a lot of subtle points to consider when trying to time code, and
>> my experience is that very few programmers get it entirely right.
>
> Really? - I mostly had to do with folks, even newbies with a
> proper CS education, who had enough experience or knowledge.
> Most problems appeared in contexts where the used languages
> have inherent design issues; not in any case we could avoid
> use of such languages in the first place.
>

Let's suppose you have a "get_time()" function that gets a time stamp
from somewhere, and that it correctly uses a volatile access from
hardware (or some OS-controlled time function that is volatile
somewhere). And suppose you are trying to time a function to test the
speed of recursion on your system :

unsigned int factorial(unsigned int x) {
if (x == 0) return 1;
return x * factorial(x - 1);
}

What happens when you write this? :

unsigned int x = 10;
double start = get_time();
unsigned int y = factorial(x);
double end = get_time();

printf("Time is %f seconds\n", end - start);

It looks reasonable enough, and because "get_time()" has observable
behaviour (a volatile access), it must be correct, right? It gives
shows a small but non-zero time, as expected.

But what you have actually measured is the overhead in the get_time()
function, because the compiler has removed the call to factorial because
the answer is not needed.

So you try :

unsigned int x = 10;
double pre_start = get_time();
double start = get_time();
unsigned int y = factorial(x);
double end = get_time();

double overhead = start - pre_start;
printf("Factorial %ui is %ui\n", x, y);
printf("Time is %f seconds\n", end - start - overhead);

to compensate for the overhead in the timing, and to force the compiler
to run factorial(10) because you observe its output. Now you get the
right answer for y, and the time is 0, because the compiler has
pre-calculated factorial x and substituted 3628800 for y.

So you take "x" from argv, so that the compiler can't pre-calculate the
result. And now the time is 0, because the compiler has re-arranged the
code as though it was :

unsigned int x = atoi(argv[1]);
double pre_start = get_time();
double start = get_time();
double end = get_time();

double overhead = start - pre_start;

unsigned int y = factorial(x);
printf("Factorial %ui is %ui\n", x, y);
printf("Time is %f seconds\n", end - start - overhead);

Making x and y both volatile gives you a time for the call to
factorial(x). It is still not measuring any recursion speed, because
the compiler has turned that function into a loop.

And that is before we start asking if you are measuring the speed of the
code, or of the memory and cache system on your PC.

I regularly see people failing to time or benchmark functions as they
expect - they don't understand how the compiler can re-arrange or
optimise things. A recurring problem is the belief that volatile
accesses force an order on other memory accesses, or on calculations,
which is not correct.

Then they decide to disable optimisation because "the optimiser messes
with my timing code", getting a result as useful as measuring the speed
of a race car stuck in first gear.

Re: iso646.h

<up8ibt$h743$1@dont-email.me>

  copy mid

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

  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.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 17:05:17 +0100
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <up8ibt$h743$1@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uomjfr$sopf$1@dont-email.me>
<uoopm9$1blvh$1@dont-email.me> <uop0r1$1d4d4$1@dont-email.me>
<uoqvas$1q40p$1@dont-email.me> <uor4rf$1r10t$1@dont-email.me>
<87frym7l3p.fsf@nosuchdomain.example.com> <uot08a$278i2$1@dont-email.me>
<uotmed$2ack6$2@dont-email.me> <up17f9$313qt$4@dont-email.me>
<up197h$31jct$1@dont-email.me> <up1gkb$32k8k$4@dont-email.me>
<up1imc$32upd$1@dont-email.me> <up1j9s$331cv$1@dont-email.me>
<up397j$3ec59$3@dont-email.me> <41btN.183056$yEgf.182064@fx09.iad>
<up3qqr$3hbk7$8@dont-email.me> <up5f80$3t99q$5@dont-email.me>
<up6e8k$2vq9$7@dont-email.me> <87le896pke.fsf@nosuchdomain.example.com>
<up6pvs$4ug9$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 29 Jan 2024 16:05:17 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="97a86bc186f2ce7a3f5aa28c9d36f604";
logging-data="564355"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX187sYAHz+rwdY9M23+mclV1LRvHKMGXMWM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:VkY8zk0UQQ0Oc2lHCVLtULSKgNg=
In-Reply-To: <up6pvs$4ug9$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Mon, 29 Jan 2024 16:05 UTC

On 29/01/2024 01:03, Lawrence D'Oliveiro wrote:
> On Sun, 28 Jan 2024 14:49:53 -0800, Keith Thompson wrote:
>
>> A lot (for some interpretations of "a lot") of embedded systems run
>> Android. Those aren't the one David was talking about.
>
> They have a POSIX-type C runtime. Which does support “%«n»$” for
> reordering args to the printf routines.
>
> The point being the prevalence of POSIX is a little larger than you give
> it credit for.

No, it is not. I doubt if there are many people here that don't know
that Android is Linux, and therefore POSIX, or that there are lots more
Android systems than Windows systems. If you exclude obvious cases like
phones, tablets, and smart TVs, there are many more embedded Linux
systems that are not Android, than embedded Android systems. Those are
all POSIX too. And yet they are all part of the 0%.

Now, it is not uncommon for the libraries of small embedded systems to
support some POSIX extensions - the "newlib" family of C libraries
supports POSIX extensions to printf formatting flags, such as control of
positional arguments. But many other embedded C libraries do not. And
support for that one extension does not imply POSIX support or
"POSIX-type C runtime" libraries.

Re: iso646.h

<up8iet$h743$2@dont-email.me>

  copy mid

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

  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.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 17:06:53 +0100
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <up8iet$h743$2@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uomjfr$sopf$1@dont-email.me>
<uoopm9$1blvh$1@dont-email.me> <uop0r1$1d4d4$1@dont-email.me>
<uoqvas$1q40p$1@dont-email.me> <uor4rf$1r10t$1@dont-email.me>
<87frym7l3p.fsf@nosuchdomain.example.com> <uot08a$278i2$1@dont-email.me>
<uotmed$2ack6$2@dont-email.me> <up17f9$313qt$4@dont-email.me>
<up197h$31jct$1@dont-email.me> <up1gkb$32k8k$4@dont-email.me>
<up1imc$32upd$1@dont-email.me> <up1j9s$331cv$1@dont-email.me>
<up397j$3ec59$3@dont-email.me> <41btN.183056$yEgf.182064@fx09.iad>
<up3qqr$3hbk7$8@dont-email.me> <up5f80$3t99q$5@dont-email.me>
<up6e8k$2vq9$7@dont-email.me> <87le896pke.fsf@nosuchdomain.example.com>
<up6pvs$4ug9$1@dont-email.me> <878r487vui.fsf@nosuchdomain.example.com>
<up71s2$621e$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 29 Jan 2024 16:06:53 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="97a86bc186f2ce7a3f5aa28c9d36f604";
logging-data="564355"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RFiMSKAFix7hjbRr0O9eW6HNmMGsmAgg="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:4g8qtjvxoe2bjvrkkoES9oF6rNI=
In-Reply-To: <up71s2$621e$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Mon, 29 Jan 2024 16:06 UTC

On 29/01/2024 03:17, Lawrence D'Oliveiro wrote:
> On Sun, 28 Jan 2024 17:48:53 -0800, Keith Thompson wrote:
>
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>
>>> The point being the prevalence of POSIX is a little larger than you
>>> give it credit for.
>>
>> Again, David wasn't talking about Android systems.
>
> No, I was, as an example of the sort of POSIX system he thought was too
> minuscule to worry about.

I think your mind-reading equipment needs adjustment. Perhaps I should
take off my tin-foil hat - would that make it easier for you to argue
against what you imagine I think?

Re: iso646.h

<up8j5h$h743$3@dont-email.me>

  copy mid

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

  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.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 17:18:57 +0100
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <up8j5h$h743$3@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uol92t$l82b$3@dont-email.me>
<uomjfr$sopf$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me>
<uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me> <87frym7l3p.fsf@nosuchdomain.example.com>
<uot08a$278i2$1@dont-email.me> <uotmed$2ack6$2@dont-email.me>
<up17f9$313qt$4@dont-email.me> <up197h$31jct$1@dont-email.me>
<up1t0r$37v5a$4@dont-email.me> <up2mor$3bjgb$1@dont-email.me>
<up2ogd$3bs86$1@dont-email.me> <up3r9c$3hbk7$10@dont-email.me>
<up47gj$3jfg4$1@dont-email.me> <87jznu1c4v.fsf@nosuchdomain.example.com>
<up4ceh$3k4b8$1@dont-email.me> <up5fk6$3t99q$6@dont-email.me>
<up5u8c$blo$1@dont-email.me> <up6655$1l8b$2@dont-email.me>
<up6b3v$2ff9$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 29 Jan 2024 16:18:57 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="97a86bc186f2ce7a3f5aa28c9d36f604";
logging-data="564355"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/XDcNyXxjTD9PDbnvIAjMdtVJgMdXdTE0="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:5s0K8BRfYIms54RYiDS+t/AXAFU=
In-Reply-To: <up6b3v$2ff9$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Mon, 29 Jan 2024 16:18 UTC

On 28/01/2024 20:49, Malcolm McLean wrote:
> On 28/01/2024 18:24, David Brown wrote:
>> On 28/01/2024 17:09, Malcolm McLean wrote:

>>> You put non-ASCII text on stdout?
>>> I mean, obviously in a program for international use itself. But in
>>> routine program for general use?
>>>
>>
>> I commonly write out in UTF-8 - it does not have to be
>> "international". (I assume that by "international" you, as a good
>> Brit, mean "not UK". After all, a program written solely for use in
>> Norwegian is not international.)
>>
> I'd expect that most general purpose programs written by Norwegians use
> an English interface, even if it isn't really expected that the program
> will find an audience beyond some users in Norway. Except of course for
> programs which in some way are about Norway.

Why?

I might write the program with English output if the output language
doesn't matter, because I am lazy and write better English than
Norwegian. I might give it English output if the program were to be
used in a context where English is prevalent already, such as a
programming utility. But if it is intended to be used by Norwegians in
general use, I'll make the output in Norwegian.

Just because Norwegians are, for the most part, very good at English,
does not mean they don't prefer Norwegian.

> >
>> Sometimes I will have binary data of some kind on the standard output.
>> It's a lot less common, but it happens.  A common example would be
>> code for generating images or other files for a webserver.
>>
>> Most of my "real" programs, rather than small utilities, are for
>> embedded systems where the concept of "standard output" is not really
>> the same as for PC's.
>>
> I've never used standard output for binary data. It might be necessary
> for webservers that serve images. But it strikes me as a poor design
> decision.

It's simply something you haven't considered. Don't assume that the
kind of programming /you/ do, or that /you/ have experience with, is in
any way representative of other kinds of programming needs or practices.

Re: iso646.h

<up8j82$h743$4@dont-email.me>

  copy mid

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

  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: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 17:20:18 +0100
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <up8j82$h743$4@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uol92t$l82b$3@dont-email.me>
<uomjfr$sopf$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me>
<uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me> <uorolm$1uaut$1@dont-email.me>
<uotnnt$2akq3$1@dont-email.me> <uou1lg$2c9us$1@dont-email.me>
<875xzh43us.fsf@nosuchdomain.example.com> <up07tb$2qm2c$1@dont-email.me>
<up0lab$2u6hl$2@dont-email.me> <up0rth$2vbj2$1@dont-email.me>
<up10ip$305rf$1@dont-email.me> <up1hom$32rbe$1@dont-email.me>
<up3c08$3evpe$1@dont-email.me> <up695s$28q6$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 29 Jan 2024 16:20:18 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="97a86bc186f2ce7a3f5aa28c9d36f604";
logging-data="564355"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18fEDI8vdzTFH/NtfO8S71yHtK0L9GzTLg="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:pobtO7B6476n/jMHZMxnRLEFIE4=
In-Reply-To: <up695s$28q6$2@dont-email.me>
Content-Language: en-GB
 by: David Brown - Mon, 29 Jan 2024 16:20 UTC

On 28/01/2024 20:16, Janis Papanagnou wrote:
> On 27.01.2024 17:46, David Brown wrote:
>> [...]
>
> FYI: Too long to read at the moment. (Maybe later, maybe not.)
>

OK. It's off-topic, and just chatter, so if you don't reply I will not
feel insulted :-)

Re: iso646.h

<up8jeh$hdaq$1@dont-email.me>

  copy mid

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

  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: iso646.h
Date: Mon, 29 Jan 2024 16:23:45 +0000
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <up8jeh$hdaq$1@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uomjfr$sopf$1@dont-email.me>
<uoopm9$1blvh$1@dont-email.me> <uop0r1$1d4d4$1@dont-email.me>
<uoqvas$1q40p$1@dont-email.me> <uor4rf$1r10t$1@dont-email.me>
<87frym7l3p.fsf@nosuchdomain.example.com> <uot08a$278i2$1@dont-email.me>
<uotmed$2ack6$2@dont-email.me> <up17f9$313qt$4@dont-email.me>
<up197h$31jct$1@dont-email.me> <up1gkb$32k8k$4@dont-email.me>
<up1imc$32upd$1@dont-email.me> <up1j9s$331cv$1@dont-email.me>
<up397j$3ec59$3@dont-email.me> <41btN.183056$yEgf.182064@fx09.iad>
<up3qqr$3hbk7$8@dont-email.me> <up5f80$3t99q$5@dont-email.me>
<up6e8k$2vq9$7@dont-email.me> <up861l$f5fj$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 29 Jan 2024 16:23:46 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="638e6a40e429a888ceaea18ff735a682";
logging-data="570714"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/7flTS6B9VOQsVs3izSkPk+PqmuRXfKxY="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:wJbMS4su+TL1gwWRWeQiCBaWDR8=
In-Reply-To: <up861l$f5fj$1@dont-email.me>
Content-Language: en-GB
 by: bart - Mon, 29 Jan 2024 16:23 UTC

On 29/01/2024 12:35, David Brown wrote:
> On 28/01/2024 21:43, Lawrence D'Oliveiro wrote:
>> On Sun, 28 Jan 2024 12:53:36 +0100, David Brown wrote:
>>
>>> On 27/01/2024 21:59, Lawrence D'Oliveiro wrote:
>>>
>>>> On Sat, 27 Jan 2024 17:26:24 GMT, Scott Lurndal wrote:
>>>>
>>>>> David Brown <david.brown@hesbynett.no> writes:
>>>>>>
>>>>>> Standard printf formatting also does not allow such re-arrangements.
>>>>>>
>>>>> Depends on what standard you use.  POSIX certainly does.
>>>>
>>>> C and POSIX go together like a horse and carriage; one without the
>>>> other is a lot less useful.
>>>
>>> To the nearest percent, 0% of all systems running C programs support
>>> POSIX (or Windows, or any other "big" system).  The world of small
>>> embedded systems totally outweigh "big" systems by many orders of
>>> magnitude.  And perhaps 80% of such small systems are programmed in C.
>>
>> And a lot of those “embedded” systems are running Android.
>
> No, they are not.  Android is Linux, and is included in the 0%.
>
>>
>> Android ships as many units per year as the entire installed base of
>> Microsoft Windows.
>
> Sure.  And it is still within the 0%.
>
> Take your car as an example.  There's a reasonable chance, if it is
> modern, that the entertainment and navigation system is running Android.
>  You might have a couple of other parts running embedded Linux of other
> types.  And you might have 100 other microcontrollers running programs
> written in C, but not running a "big" POSIX OS.  Some will run RTOS's,
> some will be bare metal.
>
> On the computer on your desk, you have a microcontroller in your mouse,
> keyboard, webcam, screen, harddisk, managed switch.  Your printer might
> have some kind of embedded Linux for its display and UI, but probably
> has many other microcontrollers in it.  Your toaster, oven, fridge,
> alarm clock, digital thermometer - microcontrollers are everywhere.

I think this is being disingenuous. Of course there are countless
millions of integrated circuits used everywhere, that will outnumber the
packaged consumer devices that everyone knows about.

Some of them may have programmable elements. But, no matter how crude,
how limited, if somebody, somewhere, has configured a program to turn a
subset of C into code for that device, that enables you to add that to
the list of systems you claim are programmed in 'C'.

Even if it relies on dedicated extensions or uses lots of inline assembly.

> Even your typical Android device - a phone or tablet - will have a few
> separate microcontrollers, and a variety of bits and pieces in its SoC
> that are programmed in C but do not have a POSIX system.
>

Maybe you can count each main CPU and each core separately too!

Re: iso646.h

<up8m55$hsfc$1@dont-email.me>

  copy mid

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

  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: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 12:09:57 -0500
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <up8m55$hsfc$1@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uol92t$l82b$3@dont-email.me>
<uomjfr$sopf$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me>
<uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me> <87frym7l3p.fsf@nosuchdomain.example.com>
<uot08a$278i2$1@dont-email.me> <uotmed$2ack6$2@dont-email.me>
<up17f9$313qt$4@dont-email.me> <up197h$31jct$1@dont-email.me>
<up1t0r$37v5a$4@dont-email.me> <up2mor$3bjgb$1@dont-email.me>
<up2ogd$3bs86$1@dont-email.me> <up2qse$3c81p$1@dont-email.me>
<up3ode$3h68j$1@dont-email.me> <up62gn$15e5$1@dont-email.me>
<87cytl6p20.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 29 Jan 2024 17:09:57 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="81c22e91475568bb1d04f1bea55e2da5";
logging-data="586220"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PU6d7IU3ZmJA2P6bOfr6/o4WC9mnFm4A="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:5cFhZbyBjWsO2wR0rRB+gwNukSM=
Content-Language: en-US
In-Reply-To: <87cytl6p20.fsf@nosuchdomain.example.com>
 by: James Kuyper - Mon, 29 Jan 2024 17:09 UTC

On 1/28/24 18:00, Keith Thompson wrote:
....
> And in environments like POSIX that don't distinguish between text and
> binary output streams, it can be perfectly sensible (though not 100%
> portable) to send binary data to stdout.

I'm sure you know about the following, but for Malcolm's benefit, I want
to expand on that comment. In other environments, the fact that stdout
is initially a text stream means that freopen() would have to be used to
change it to a binary stream - but it is otherwise no more of a problem
than in a POSIX environment.

Re: iso646.h

<up8nv8$i3uj$1@dont-email.me>

  copy mid

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

  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.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 18:40:56 +0100
Organization: A noiseless patient Spider
Lines: 84
Message-ID: <up8nv8$i3uj$1@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uomjfr$sopf$1@dont-email.me>
<uoopm9$1blvh$1@dont-email.me> <uop0r1$1d4d4$1@dont-email.me>
<uoqvas$1q40p$1@dont-email.me> <uor4rf$1r10t$1@dont-email.me>
<87frym7l3p.fsf@nosuchdomain.example.com> <uot08a$278i2$1@dont-email.me>
<uotmed$2ack6$2@dont-email.me> <up17f9$313qt$4@dont-email.me>
<up197h$31jct$1@dont-email.me> <up1gkb$32k8k$4@dont-email.me>
<up1imc$32upd$1@dont-email.me> <up1j9s$331cv$1@dont-email.me>
<up397j$3ec59$3@dont-email.me> <41btN.183056$yEgf.182064@fx09.iad>
<up3qqr$3hbk7$8@dont-email.me> <up5f80$3t99q$5@dont-email.me>
<up6e8k$2vq9$7@dont-email.me> <up861l$f5fj$1@dont-email.me>
<up8jeh$hdaq$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 29 Jan 2024 17:40:56 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="dbef85c42adbfd877b17076ac7da0f1d";
logging-data="593875"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+HjfjZYbb7JcVxINyEg3DtRzZWCqCB9/M="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:6wJP9E7kmV9Pwyq7hXbSVRxyP/8=
In-Reply-To: <up8jeh$hdaq$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Mon, 29 Jan 2024 17:40 UTC

On 29/01/2024 17:23, bart wrote:
> On 29/01/2024 12:35, David Brown wrote:
>> On 28/01/2024 21:43, Lawrence D'Oliveiro wrote:
>>> On Sun, 28 Jan 2024 12:53:36 +0100, David Brown wrote:
>>>
>>>> On 27/01/2024 21:59, Lawrence D'Oliveiro wrote:
>>>>
>>>>> On Sat, 27 Jan 2024 17:26:24 GMT, Scott Lurndal wrote:
>>>>>
>>>>>> David Brown <david.brown@hesbynett.no> writes:
>>>>>>>
>>>>>>> Standard printf formatting also does not allow such re-arrangements.
>>>>>>>
>>>>>> Depends on what standard you use.  POSIX certainly does.
>>>>>
>>>>> C and POSIX go together like a horse and carriage; one without the
>>>>> other is a lot less useful.
>>>>
>>>> To the nearest percent, 0% of all systems running C programs support
>>>> POSIX (or Windows, or any other "big" system).  The world of small
>>>> embedded systems totally outweigh "big" systems by many orders of
>>>> magnitude.  And perhaps 80% of such small systems are programmed in C.
>>>
>>> And a lot of those “embedded” systems are running Android.
>>
>> No, they are not.  Android is Linux, and is included in the 0%.
>>
>>>
>>> Android ships as many units per year as the entire installed base of
>>> Microsoft Windows.
>>
>> Sure.  And it is still within the 0%.
>>
>> Take your car as an example.  There's a reasonable chance, if it is
>> modern, that the entertainment and navigation system is running
>> Android.   You might have a couple of other parts running embedded
>> Linux of other types.  And you might have 100 other microcontrollers
>> running programs written in C, but not running a "big" POSIX OS.  Some
>> will run RTOS's, some will be bare metal.
>>
>> On the computer on your desk, you have a microcontroller in your
>> mouse, keyboard, webcam, screen, harddisk, managed switch.  Your
>> printer might have some kind of embedded Linux for its display and UI,
>> but probably has many other microcontrollers in it.  Your toaster,
>> oven, fridge, alarm clock, digital thermometer - microcontrollers are
>> everywhere.
>
> I think this is being disingenuous. Of course there are countless
> millions of integrated circuits used everywhere, that will outnumber the
> packaged consumer devices that everyone knows about.
>
> Some of them may have programmable elements. But, no matter how crude,
> how limited, if somebody, somewhere, has configured a program to turn a
> subset of C into code for that device, that enables you to add that to
> the list of systems you claim are programmed in 'C'.

I am talking about systems with CPUs of some sort that are regularly
programmed in C. I am not including chips that just have configuration,
or 4-bit devices that are programmed in their own Forth-like assembly.

>
> Even if it relies on dedicated extensions or uses lots of inline assembly.
>

Sure. I am not suggesting that these devices are programmed /solely/ in
C - certainly not solely in standard and portable C. But then, few
programs on PC's or other "big" systems are programmed solely in pure
standard C.

And I am not restricting this to devices that the end user can program
in C. Most devices cannot be accessed or re-programmed by the end-user
- some cannot be reprogrammed at all, with the program in ROM of some kind.

>> Even your typical Android device - a phone or tablet - will have a few
>> separate microcontrollers, and a variety of bits and pieces in its SoC
>> that are programmed in C but do not have a POSIX system.
>>
>
> Maybe you can count each main CPU and each core separately too!

That would change the dynamics a bit, but it would not change the
overall point.

Re: iso646.h

<up8qvp$io5t$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: malcolm....@gmail.com (Malcolm McLean)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 18:32:23 +0000
Organization: A noiseless patient Spider
Lines: 100
Message-ID: <up8qvp$io5t$1@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uol92t$l82b$3@dont-email.me>
<uomjfr$sopf$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me>
<uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me> <uorolm$1uaut$1@dont-email.me>
<uotnnt$2akq3$1@dont-email.me> <uou1lg$2c9us$1@dont-email.me>
<875xzh43us.fsf@nosuchdomain.example.com> <up07tb$2qm2c$1@dont-email.me>
<up0lab$2u6hl$2@dont-email.me> <up0rth$2vbj2$1@dont-email.me>
<up10ip$305rf$1@dont-email.me> <up1hom$32rbe$1@dont-email.me>
<up1ru6$37v5a$1@dont-email.me> <up2m6r$3bh1b$1@dont-email.me>
<up2nrk$3bnll$1@dont-email.me> <up2prg$3c32r$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 29 Jan 2024 18:32:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e807052cfdbcc190c8099eca6c57543e";
logging-data="614589"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+bkB/tyOsYTZN3L6QGPPf00xLPzJJkVyM="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:cNZE9Xstj+ohunGwwXHq6UpOXH4=
Content-Language: en-GB
In-Reply-To: <up2prg$3c32r$1@dont-email.me>
 by: Malcolm McLean - Mon, 29 Jan 2024 18:32 UTC

On 27/01/2024 11:36, Janis Papanagnou wrote:
> On 27.01.2024 12:02, Malcolm McLean wrote:
>> On 27/01/2024 10:34, Janis Papanagnou wrote:
>>> On 27.01.2024 04:05, Malcolm McLean wrote:
>>>> [...] Personally I wanted just
>>>> "function" and for it to be clear from context that here the term did
>>>> not mean "subroutine".
>>>
>>> In my book; there's the "concept function" (mathematical), and the
>>> mapping/implementation onto/in a computer (a "calculation routine").
>>> The latter has just different names in different languages and it
>>> naturally has different technical details. In any form its purpose
>>> is to be an implemented instance of a formal mathematical concept.
>>>
>>> Janis
>>>
>>
>> I don't really see how "Bleep" is any sort of mathematical function. But
>> it is clearly a "subroutine".
>
> I don't know what that 'Bleep' is that you mention here, but I suppose
> that is meant to be some function that is not returning a value but an
> acoustic _side effect_. In an Algol representation something like the
> function
>
> bleep = (void) void: invoke_tone
>
> Or in Simula or Pascal the return-typeless function (= 'procedure')
>
> procedure bleep
>
> Or in C the function
>
> bleep() { invoke_tone; }
>
> In FORTRAN and BASIC (don't remember) that function was maybe called
> "subroutine"?
>
> Nomenclature changes wording but not its underlying character. Use the
> terms and models that fit best your goals. Meta-goals may be to clarify
> or to muddy the issue or its details.
>
> The term "subroutine" (for me) comprises two aspects; a hierarchical
> relation, and a [computation] process character.
>
Yes, it sort of implied that a subroutine will be called from and return
control to what is ultimately a main routine. Most programs work like
that, but not all.

>
> I'm unsure whether you wanted to express that functions with return
> type void are different from functions that return non-void types and
> should thus not be called functions? Other's may say that "subroutine"
> is badly chosen since there's not necessarily a hierarchical semantic
> when using "procedures" in context of Simula's classes with coroutines.
> Or are you saying that any "non-pure" function generally relies on
> side-effects and should be considered and named differently? - I'm fine
> with it. As long as it's clear what goals we follow, and whether the
> nomenclature is appropriate for that specific goal (and not conflicts
> with other goals).
>
In many languages, including C, there's a difference between functions
that return a value and functions that don't, in that

if (realloc(ptr, 0))

is allowed

whilst

if (free(ptr))

is not. And that's important if you are writing a compiler. In C, it
doesn't capture anything important for the user. You can return values
via the return type or via passed in pointers, and that's not a design
decision with any big implications.
Now in some languages, but not C, realloc() would be a "function" and
free() a "procedure".

What I was saying was that these words already exist, but they aren't
being used in a very useful way, so lets use "function" for subroutines
which calculate something and "procedure" for subroutines which do
something. The we've got all sorts of benefits which are very similar to
both "pure functions" and "functional programming". They're related
ideas but a slightly different take on it.

However because people are so focused on "function shall mean a C
subroutine" the regulars rejected the usage, and insisted that a C
subroutine which calculates something shall be termed a "Malcolm
function". So that's we call them here. A "Malcolm function" is a C
function which is also a mathematical function.

If you separate out the Malcolm functions from the other functions, you
find that the Malcolm functions can be written portably. Which is the
main advantage of doing it.

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

Re: iso646.h

<up8r1n$ioh9$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 19:33:26 +0100
Organization: A noiseless patient Spider
Lines: 68
Message-ID: <up8r1n$ioh9$1@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uol92t$l82b$3@dont-email.me>
<uomjfr$sopf$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me>
<uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me> <87frym7l3p.fsf@nosuchdomain.example.com>
<uot08a$278i2$1@dont-email.me> <uotmed$2ack6$2@dont-email.me>
<up17f9$313qt$4@dont-email.me> <up197h$31jct$1@dont-email.me>
<up1t0r$37v5a$4@dont-email.me> <up2mor$3bjgb$1@dont-email.me>
<up2ogd$3bs86$1@dont-email.me> <up2qse$3c81p$1@dont-email.me>
<up3ode$3h68j$1@dont-email.me> <up62gn$15e5$1@dont-email.me>
<87cytl6p20.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 29 Jan 2024 18:33:27 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="46dd0497685e921ad0b2690b3da6ba15";
logging-data="614953"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ntYVaRWAQE7dp9IO9tkor"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:2r3gebRdb4XGEHMfxM+tNbUmR4w=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <87cytl6p20.fsf@nosuchdomain.example.com>
 by: Janis Papanagnou - Mon, 29 Jan 2024 18:33 UTC

On 29.01.2024 00:00, Keith Thompson wrote:
> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>> On 27.01.2024 21:17, Malcolm McLean wrote:
> [...]
>>> printf() is the
>>> main C interface to that, and supports integers, floats and strings, to
>>> a first approximation.
>>
>> It's not an approximation; printf() is _restricted_ to these types (and
>> a few more variants of these few basic types, to be correct).
>
> printf also supports pointer values with "%p". And it support single
> characters, which are not strings.
>
> strings of cousre absolutely do not have to be ASCII. Using printf to
> print data with embedded null bytes is tricky

I haven't tried with a pure C compiler but with a C++ compiler
it works fine (see below). - Just don't make the mistake to try
to embed a NUL inside a string constant, like

printf ("%s\n", "My\0string");

which won't work as some may expect (you will only see "My").

> -- but of course printf is
> not the only interface. We can print arbitrary data with putchar,
> fwrite, etc.

I use the Unix I/O functions as well (i.e. 'write' etc.).

With printf or cout I can print binary, non-ASCII, UTF-8 encoded
characters...

std::cout << "Ölübelkeitäußerung" << std::endl;
printf("%s\n", "Ölübelkeitäußerung");

$ utf8out
Ölübelkeitäußerung
Ölübelkeitäußerung

cout << (char)0x02 << (char)0x01 << (char)0x00 << (char)0xff
<< (char)0xfe << (char)0x80 << (char)0x7f << (char)0x0a;

printf("%c%c%c%c%c%c%c%c",
(char)0x02, (char)0x01, (char)0x00, (char)0xff,
(char)0xfe, (char)0x80, (char)0x7f, (char)0x0a);

$ binout | od -t x1
0000000 02 01 00 ff fe 80 7f 0a 02 01 00 ff fe 80 7f 0a
0000020

>
> And in environments like POSIX that don't distinguish between text and
> binary output streams,

Also keep in mind that you can modify the output system attributes;
in these cases of a modified channel you may not see what you sent.

> it can be perfectly sensible (though not 100%
> portable) to send binary data to stdout.

Not observed (by me) in the environments I was using the past decades.

Janis

Re: iso646.h

<up8rig$iras$1@dont-email.me>

  copy mid

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

  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: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 12:10:15 -0500
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <up8rig$iras$1@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uol92t$l82b$3@dont-email.me>
<uomjfr$sopf$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me>
<uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me> <87frym7l3p.fsf@nosuchdomain.example.com>
<uot08a$278i2$1@dont-email.me> <uotmed$2ack6$2@dont-email.me>
<up17f9$313qt$4@dont-email.me> <up197h$31jct$1@dont-email.me>
<up1t0r$37v5a$4@dont-email.me> <up2mor$3bjgb$1@dont-email.me>
<up2ogd$3bs86$1@dont-email.me> <up2qse$3c81p$1@dont-email.me>
<up3ode$3h68j$1@dont-email.me> <up62gn$15e5$1@dont-email.me>
<87cytl6p20.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 29 Jan 2024 18:42:24 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="81c22e91475568bb1d04f1bea55e2da5";
logging-data="617820"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18N5z+1lkIb5GgkP5ZkS6IKUb+NH9PpjVI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:gIOyMvBNJDYjIzTAM+WXk22rcJY=
Content-Language: en-US
In-Reply-To: <87cytl6p20.fsf@nosuchdomain.example.com>
 by: James Kuyper - Mon, 29 Jan 2024 17:10 UTC

On 1/28/24 18:00, Keith Thompson wrote:
....
> And in environments like POSIX that don't distinguish between text and
> binary output streams, it can be perfectly sensible (though not 100%
> portable) to send binary data to stdout.

I'm sure you know about the following, but for Malcolm's benefit, I want
to expand on that comment. In other environments, the fact that stdout
is initially a text stream means that freopen() would have to be used to
change it to a binary stream - but it is otherwise no more of a problem
than in a POSIX environment.

Re: iso646.h

<up8rsj$it3f$1@dont-email.me>

  copy mid

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

  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: malcolm....@gmail.com (Malcolm McLean)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 18:47:46 +0000
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <up8rsj$it3f$1@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uol92t$l82b$3@dont-email.me>
<uomjfr$sopf$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me>
<uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me> <87frym7l3p.fsf@nosuchdomain.example.com>
<uot08a$278i2$1@dont-email.me> <uotmed$2ack6$2@dont-email.me>
<up17f9$313qt$4@dont-email.me> <up197h$31jct$1@dont-email.me>
<up1t0r$37v5a$4@dont-email.me> <up2mor$3bjgb$1@dont-email.me>
<up2ogd$3bs86$1@dont-email.me> <up3r9c$3hbk7$10@dont-email.me>
<up47gj$3jfg4$1@dont-email.me> <87jznu1c4v.fsf@nosuchdomain.example.com>
<up4ceh$3k4b8$1@dont-email.me> <up5fk6$3t99q$6@dont-email.me>
<up5u8c$blo$1@dont-email.me> <up6655$1l8b$2@dont-email.me>
<up6b3v$2ff9$1@dont-email.me> <up8j5h$h743$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 29 Jan 2024 18:47:47 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e807052cfdbcc190c8099eca6c57543e";
logging-data="619631"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18FWfIeJoQOZKxwZa1nM3O0L2DlG9nTcQE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:SfeV7imDpm3Swu2hGXQvaqAooZo=
Content-Language: en-GB
In-Reply-To: <up8j5h$h743$3@dont-email.me>
 by: Malcolm McLean - Mon, 29 Jan 2024 18:47 UTC

On 29/01/2024 16:18, David Brown wrote:
> On 28/01/2024 20:49, Malcolm McLean wrote:
>> On 28/01/2024 18:24, David Brown wrote:
>>>
>> I'd expect that most general purpose programs written by Norwegians
>> use an English interface, even if it isn't really expected that the
>> program will find an audience beyond some users in Norway. Except of
>> course for programs which in some way are about Norway.
>
> Why?
>
Generally programmers are educated people and educated people use
English for serious purposes. Not always of course and Norway might be
an exception. But I'd expect that in a Norweigian university, for
example, it would be forbidden to document a program in Norwegian or to
use non-English words for identifiers. And probably the same in a large
Norwegina company. I might be wrong about that and I have never visited
Norway or worked for a Norweigian employer (and obviously I couldn't do
so unless the policy I expect was followed).
>
>> I've never used standard output for binary data. It might be necessary
>> for webservers that serve images. But it strikes me as a poor design
>> decision.
>
> It's simply something you haven't considered.  Don't assume that the
> kind of programming /you/ do, or that /you/ have experience with, is in
> any way representative of other kinds of programming needs or practices.
>
Well no, I'm not the only programmer in the world and I work in a niche
which isn't very typical of the industry as a whole. But I don't think my
use of standard output is all that untypical. It's unacceptable for
anything released to customers and is used mainly for debugging. I also
use it for
hobby programming. But I don't write web serve programs that need to put
binary images on standard output, I wasn't aware that this is sometimes
necessary and, as I say, it strikes me as a poor design decision.
--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

Re: iso646.h

<up8rtr$ita8$1@dont-email.me>

  copy mid

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

  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.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 19:48:27 +0100
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <up8rtr$ita8$1@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uol92t$l82b$3@dont-email.me>
<uomjfr$sopf$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me>
<uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me> <uorolm$1uaut$1@dont-email.me>
<uotnnt$2akq3$1@dont-email.me> <uou1lg$2c9us$1@dont-email.me>
<875xzh43us.fsf@nosuchdomain.example.com> <up07tb$2qm2c$1@dont-email.me>
<up0lab$2u6hl$2@dont-email.me> <up0rth$2vbj2$1@dont-email.me>
<up10ip$305rf$1@dont-email.me> <up1hom$32rbe$1@dont-email.me>
<up1ru6$37v5a$1@dont-email.me> <up2m6r$3bh1b$1@dont-email.me>
<up2nrk$3bnll$1@dont-email.me> <up2prg$3c32r$1@dont-email.me>
<up8qvp$io5t$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 29 Jan 2024 18:48:27 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="dbef85c42adbfd877b17076ac7da0f1d";
logging-data="619848"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18dV1SziVD/9rxtLgOnFnwVBNZFiNmBveU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:SmMPEZ6G/xv33Of1gkKPQNHSMGo=
Content-Language: en-GB
In-Reply-To: <up8qvp$io5t$1@dont-email.me>
 by: David Brown - Mon, 29 Jan 2024 18:48 UTC

On 29/01/2024 19:32, Malcolm McLean wrote:
> On 27/01/2024 11:36, Janis Papanagnou wrote:
>> On 27.01.2024 12:02, Malcolm McLean wrote:
>>> On 27/01/2024 10:34, Janis Papanagnou wrote:
>>>> On 27.01.2024 04:05, Malcolm McLean wrote:

> In many languages, including C, there's a difference between functions
> that return a value and functions that don't, in that

In some languages, yes.

>
> if (realloc(ptr, 0))
>
> is allowed
>
> whilst
>
> if (free(ptr))

struct S { int a, b; };

struct S foo(void);

foo() returns a value, but "if (foo())" is not allowed.

C does not make much difference between functions that return a value,
and those that don't. The key distinction is whether the "return"
statement must have an expression or must not have an expression.

I don't disagree that it can be useful to distinguish between different
types of functions. I /do/ disagree with your attempts to classify
them, which I do not think are useful or well-defined categories.

And just because particular terms are used in some other context, does
not mean you get to define them yourself for use in other contexts, or
apply to them to languages that do not use those terms.

A "function" here is a "C function" in terms of the C standard. If you
want to talk about anything else, define what you mean at the time.

Re: iso646.h

<20240129112925.302@kylheku.com>

  copy mid

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

  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-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 19:35:22 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 61
Message-ID: <20240129112925.302@kylheku.com>
References: <uokhnk$eiln$1@dont-email.me> <uol92t$l82b$3@dont-email.me>
<uomjfr$sopf$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me>
<uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me> <uorolm$1uaut$1@dont-email.me>
<uotnnt$2akq3$1@dont-email.me> <uou1lg$2c9us$1@dont-email.me>
<875xzh43us.fsf@nosuchdomain.example.com> <up07tb$2qm2c$1@dont-email.me>
<up0lab$2u6hl$2@dont-email.me> <up0rth$2vbj2$1@dont-email.me>
<up10ip$305rf$1@dont-email.me> <up1hom$32rbe$1@dont-email.me>
<up1ru6$37v5a$1@dont-email.me> <up2m6r$3bh1b$1@dont-email.me>
<up2nrk$3bnll$1@dont-email.me> <up2prg$3c32r$1@dont-email.me>
<up8qvp$io5t$1@dont-email.me> <up8rtr$ita8$1@dont-email.me>
Injection-Date: Mon, 29 Jan 2024 19:35:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3ec620be052481378987129634f48bf3";
logging-data="633419"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18JkxYQe/Ir2o4ffbxTSxEIAZHhmlNj63w="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:udDUxte7RQRVHNaFB3Pd4YIRKF4=
 by: Kaz Kylheku - Mon, 29 Jan 2024 19:35 UTC

On 2024-01-29, David Brown <david.brown@hesbynett.no> wrote:
> On 29/01/2024 19:32, Malcolm McLean wrote:
>> On 27/01/2024 11:36, Janis Papanagnou wrote:
>>> On 27.01.2024 12:02, Malcolm McLean wrote:
>>>> On 27/01/2024 10:34, Janis Papanagnou wrote:
>>>>> On 27.01.2024 04:05, Malcolm McLean wrote:
>
>
>> In many languages, including C, there's a difference between functions
>> that return a value and functions that don't, in that
>
> In some languages, yes.
>
>>
>> if (realloc(ptr, 0))
>>
>> is allowed
>>
>> whilst
>>
>> if (free(ptr))
>
> struct S { int a, b; };
>
> struct S foo(void);
>
> foo() returns a value, but "if (foo())" is not allowed.
>
> C does not make much difference between functions that return a value,
> and those that don't. The key distinction is whether the "return"
> statement must have an expression or must not have an expression.

Don't forget that we can have:

struct S s = foo();

not to mention

struct S bar(void) { return foo(); }

as well as:

extern bar(struct S);

bar(foo());

none of which patterns is possible if foo returns void.

A void return is qualitatively different. A function which returns
a value can plausibly belong into the functional domain. A function
which returns void is necessarily an imperative procedure.

Even if it does nothing, a void foo() function it is a procedure in that
it cannot be planted into a functional expression like bar(foo()).

So we can identify an emergent category there.

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

Re: iso646.h

<up90gs$jkcu$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.furie.org.uk!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 21:06:52 +0100
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <up90gs$jkcu$1@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uol92t$l82b$3@dont-email.me>
<uomjfr$sopf$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me>
<uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me> <87frym7l3p.fsf@nosuchdomain.example.com>
<uot08a$278i2$1@dont-email.me> <uotmed$2ack6$2@dont-email.me>
<up17f9$313qt$4@dont-email.me> <up197h$31jct$1@dont-email.me>
<up1t0r$37v5a$4@dont-email.me> <up2mor$3bjgb$1@dont-email.me>
<up2ogd$3bs86$1@dont-email.me> <up3r9c$3hbk7$10@dont-email.me>
<up47gj$3jfg4$1@dont-email.me> <87jznu1c4v.fsf@nosuchdomain.example.com>
<up4ceh$3k4b8$1@dont-email.me> <up5fk6$3t99q$6@dont-email.me>
<up5u8c$blo$1@dont-email.me> <up6655$1l8b$2@dont-email.me>
<up6b3v$2ff9$1@dont-email.me> <up8j5h$h743$3@dont-email.me>
<up8rsj$it3f$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 29 Jan 2024 20:06:52 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="dbef85c42adbfd877b17076ac7da0f1d";
logging-data="643486"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19KXQfLWRDnJGETkKRgPj4Apz5ZFL/9vSE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Fod7u9rh+0Lj1iLigPF2VVTM0Lo=
Content-Language: en-GB
In-Reply-To: <up8rsj$it3f$1@dont-email.me>
 by: David Brown - Mon, 29 Jan 2024 20:06 UTC

On 29/01/2024 19:47, Malcolm McLean wrote:
> On 29/01/2024 16:18, David Brown wrote:
>> On 28/01/2024 20:49, Malcolm McLean wrote:
>>> On 28/01/2024 18:24, David Brown wrote:
>>>>
>>> I'd expect that most general purpose programs written by Norwegians
>>> use an English interface, even if it isn't really expected that the
>>> program will find an audience beyond some users in Norway. Except of
>>> course for programs which in some way are about Norway.
>>
>> Why?
>>
> Generally programmers are educated people and educated people use
> English for serious purposes.

I think you should probably stop there before you insult people.

> Not always of course and Norway might be
> an exception. But I'd expect that in a Norweigian university, for
> example, it would be forbidden to document a program in Norwegian or to
> use non-English words for identifiers. And probably the same in a large
> Norwegina company. I might be wrong about that and I have never visited
> Norway or worked for a Norweigian employer (and obviously I couldn't do
> so unless the policy I expect was followed).

You are wrong. And it is not something special about Norway.

You are coming across as the kind of ignorant and inconsiderate git who
thinks the way to talk to Jonny Foreigner is slowly and loudly.

Please stop before you embarrass yourself more.

Re: iso646.h

<86zfwnc34o.fsf@linuxsc.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 12:10:15 -0800
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <86zfwnc34o.fsf@linuxsc.com>
References: <uokhnk$eiln$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me> <uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me> <uor4rf$1r10t$1@dont-email.me> <87frym7l3p.fsf@nosuchdomain.example.com> <uot08a$278i2$1@dont-email.me> <uotmed$2ack6$2@dont-email.me> <up17f9$313qt$4@dont-email.me> <up197h$31jct$1@dont-email.me> <up1t0r$37v5a$4@dont-email.me> <up2mor$3bjgb$1@dont-email.me> <up2ogd$3bs86$1@dont-email.me> <up3r9c$3hbk7$10@dont-email.me> <up47gj$3jfg4$1@dont-email.me> <87jznu1c4v.fsf@nosuchdomain.example.com> <up4ceh$3k4b8$1@dont-email.me> <up5fk6$3t99q$6@dont-email.me> <up5u8c$blo$1@dont-email.me> <up6655$1l8b$2@dont-email.me> <up6b3v$2ff9$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="cd3adc4099bd68559ae259bfa6cea774";
logging-data="633582"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19jSOJLqnvsc5KHs4SJn2ZKr4pszYXGlcw="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:+HnPEZvb2NPQINEJflCAg2wiczo=
sha1:X1S9C/VLnuayKpfB1Bais/xNaCA=
 by: Tim Rentsch - Mon, 29 Jan 2024 20:10 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:

[...]

> I've never used standard output for binary data.
> [...] it strikes me as a poor design decision.

How so?

Re: iso646.h

<up90o0$jkcu$2@dont-email.me>

  copy mid

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

  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.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 21:10:40 +0100
Organization: A noiseless patient Spider
Lines: 72
Message-ID: <up90o0$jkcu$2@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uol92t$l82b$3@dont-email.me>
<uomjfr$sopf$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me>
<uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me> <uorolm$1uaut$1@dont-email.me>
<uotnnt$2akq3$1@dont-email.me> <uou1lg$2c9us$1@dont-email.me>
<875xzh43us.fsf@nosuchdomain.example.com> <up07tb$2qm2c$1@dont-email.me>
<up0lab$2u6hl$2@dont-email.me> <up0rth$2vbj2$1@dont-email.me>
<up10ip$305rf$1@dont-email.me> <up1hom$32rbe$1@dont-email.me>
<up1ru6$37v5a$1@dont-email.me> <up2m6r$3bh1b$1@dont-email.me>
<up2nrk$3bnll$1@dont-email.me> <up2prg$3c32r$1@dont-email.me>
<up8qvp$io5t$1@dont-email.me> <up8rtr$ita8$1@dont-email.me>
<20240129112925.302@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 29 Jan 2024 20:10:40 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="dbef85c42adbfd877b17076ac7da0f1d";
logging-data="643486"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19vgDCTBMdWMP8TfLZf9PUmC0e4Hpz8BYg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:b21mMb37FPb98I6OeUM1o0s6t8E=
In-Reply-To: <20240129112925.302@kylheku.com>
Content-Language: en-GB
 by: David Brown - Mon, 29 Jan 2024 20:10 UTC

On 29/01/2024 20:35, Kaz Kylheku wrote:
> On 2024-01-29, David Brown <david.brown@hesbynett.no> wrote:
>> On 29/01/2024 19:32, Malcolm McLean wrote:
>>> On 27/01/2024 11:36, Janis Papanagnou wrote:
>>>> On 27.01.2024 12:02, Malcolm McLean wrote:
>>>>> On 27/01/2024 10:34, Janis Papanagnou wrote:
>>>>>> On 27.01.2024 04:05, Malcolm McLean wrote:
>>
>>
>>> In many languages, including C, there's a difference between functions
>>> that return a value and functions that don't, in that
>>
>> In some languages, yes.
>>
>>>
>>> if (realloc(ptr, 0))
>>>
>>> is allowed
>>>
>>> whilst
>>>
>>> if (free(ptr))
>>
>> struct S { int a, b; };
>>
>> struct S foo(void);
>>
>> foo() returns a value, but "if (foo())" is not allowed.
>>
>> C does not make much difference between functions that return a value,
>> and those that don't. The key distinction is whether the "return"
>> statement must have an expression or must not have an expression.
>
> Don't forget that we can have:
>
> struct S s = foo();
>
> not to mention
>
> struct S bar(void) { return foo(); }
>
> as well as:
>
> extern bar(struct S);
>
> bar(foo());
>
> none of which patterns is possible if foo returns void.

Sure. But Malcolm suggested that the "if" pattern was a special
distinguishing feature. (He has already made it clear that the only
types of interest, in his world, are integers, floats and strings.)

>
> A void return is qualitatively different. A function which returns
> a value can plausibly belong into the functional domain. A function
> which returns void is necessarily an imperative procedure.
>
> Even if it does nothing, a void foo() function it is a procedure in that
> it cannot be planted into a functional expression like bar(foo()).
>
> So we can identify an emergent category there.
>

Certainly there is a distinction between void and non-void functions -
but often it is not a particularly important one. What a function does,
what kind of side-effects it has, how its behaviour and values interact
with other parts of the code, how it interacts with other threads, are
far more interesting aspects for classification. (And part of the
interest is that these features are not normally specified in the code.)

Re: iso646.h

<871q9z7toc.fsf@nosuchdomain.example.com>

  copy mid

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

  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: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 12:48:03 -0800
Organization: None to speak of
Lines: 60
Message-ID: <871q9z7toc.fsf@nosuchdomain.example.com>
References: <uokhnk$eiln$1@dont-email.me> <uol92t$l82b$3@dont-email.me>
<uomjfr$sopf$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me>
<uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me>
<87frym7l3p.fsf@nosuchdomain.example.com>
<uot08a$278i2$1@dont-email.me> <uotmed$2ack6$2@dont-email.me>
<up17f9$313qt$4@dont-email.me> <up197h$31jct$1@dont-email.me>
<up1t0r$37v5a$4@dont-email.me> <up2mor$3bjgb$1@dont-email.me>
<up2ogd$3bs86$1@dont-email.me> <up2qse$3c81p$1@dont-email.me>
<up3ode$3h68j$1@dont-email.me> <up62gn$15e5$1@dont-email.me>
<87cytl6p20.fsf@nosuchdomain.example.com>
<up8r1n$ioh9$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="7785f266d7a579ac4bdae19d9302dff6";
logging-data="659781"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/DYSHI/TqyJ5GAwZ6asfka"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:MAr8jwZTewSgW4S+bD2oXypGfLA=
sha1:T7djmSPk9aPEeqIKlnpOrUNBN3U=
 by: Keith Thompson - Mon, 29 Jan 2024 20:48 UTC

Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
> On 29.01.2024 00:00, Keith Thompson wrote:
>> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>>> On 27.01.2024 21:17, Malcolm McLean wrote:
>> [...]
>>>> printf() is the
>>>> main C interface to that, and supports integers, floats and strings, to
>>>> a first approximation.
>>>
>>> It's not an approximation; printf() is _restricted_ to these types (and
>>> a few more variants of these few basic types, to be correct).
>>
>> printf also supports pointer values with "%p". And it support single
>> characters, which are not strings.
>>
>> strings of cousre absolutely do not have to be ASCII. Using printf to
>> print data with embedded null bytes is tricky
>
> I haven't tried with a pure C compiler but with a C++ compiler
> it works fine (see below). - Just don't make the mistake to try
> to embed a NUL inside a string constant, like
>
> printf ("%s\n", "My\0string");
>
> which won't work as some may expect (you will only see "My").

Right, that's what's tricky about it. printf with "%s" treats the
corresponding argument as a pointer to a string, which means that it
ignores anything after the first null character. If you want to print
"My", followed by a null byte, followed by "string", you'll have to use
a different technique.

And the argument doesn't have to be a string constant for this to be
relevant. Printing arbitrary data with printf("%s", ...) is likely to
fail if the data contains null bytes. fwrite() is likely to be a better
choice. Both printf() and fwrite() work as if by repeated calls to
fputc().

[...]
>> it can be perfectly sensible (though not 100% portable) to send
>> binary data to stdout.
>
> Not observed (by me) in the environments I was using the past decades.

To list the contents of a .tgz file, you can do:

zcat foo.tgz | tar tf -

zcat and tar are implemented in C (I think; if not, they certainly could
be). In this command, zcat is writing binary data to stdout, and tar is
reading binary data from stdin. (GNU tar can also read directly from a
gzipped tar file, but that doesn't wouldn't illustrate the point.)

Of course all this can fail on systems with a strong distinction between
text and binary streams.

--
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: iso646.h

<87wmrr6evk.fsf@nosuchdomain.example.com>

  copy mid

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

  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: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 12:53:03 -0800
Organization: None to speak of
Lines: 21
Message-ID: <87wmrr6evk.fsf@nosuchdomain.example.com>
References: <uokhnk$eiln$1@dont-email.me> <uol92t$l82b$3@dont-email.me>
<uomjfr$sopf$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me>
<uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me>
<87frym7l3p.fsf@nosuchdomain.example.com>
<uot08a$278i2$1@dont-email.me> <uotmed$2ack6$2@dont-email.me>
<up17f9$313qt$4@dont-email.me> <up197h$31jct$1@dont-email.me>
<up1t0r$37v5a$4@dont-email.me> <up2mor$3bjgb$1@dont-email.me>
<up2ogd$3bs86$1@dont-email.me> <up2qse$3c81p$1@dont-email.me>
<up3ode$3h68j$1@dont-email.me> <up62gn$15e5$1@dont-email.me>
<87cytl6p20.fsf@nosuchdomain.example.com>
<up8rig$iras$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="7785f266d7a579ac4bdae19d9302dff6";
logging-data="659781"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19lc5GUBiyIGb1IZz30sF7p"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:9D/oq6rl7xKoo5/blwYywN0BXGo=
sha1:3cd7LL02Vzbvoy8zQ+RkOy4Wqzs=
 by: Keith Thompson - Mon, 29 Jan 2024 20:53 UTC

James Kuyper <jameskuyper@alumni.caltech.edu> writes:
> On 1/28/24 18:00, Keith Thompson wrote:
> ...
>> And in environments like POSIX that don't distinguish between text and
>> binary output streams, it can be perfectly sensible (though not 100%
>> portable) to send binary data to stdout.
>
> I'm sure you know about the following, but for Malcolm's benefit, I want
> to expand on that comment. In other environments, the fact that stdout
> is initially a text stream means that freopen() would have to be used to
> change it to a binary stream - but it is otherwise no more of a problem
> than in a POSIX environment.

I actually didn't know (or didn't remember) that freopen() with a null
pointer as the filename argument changes the mode of the stream. That
ability was added in C99.

--
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: iso646.h

<87sf2f6eip.fsf@nosuchdomain.example.com>

  copy mid

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

  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: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 13:00:46 -0800
Organization: None to speak of
Lines: 39
Message-ID: <87sf2f6eip.fsf@nosuchdomain.example.com>
References: <uokhnk$eiln$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me>
<87frym7l3p.fsf@nosuchdomain.example.com>
<uot08a$278i2$1@dont-email.me> <uotmed$2ack6$2@dont-email.me>
<up17f9$313qt$4@dont-email.me> <up197h$31jct$1@dont-email.me>
<up1t0r$37v5a$4@dont-email.me> <up2mor$3bjgb$1@dont-email.me>
<up2ogd$3bs86$1@dont-email.me> <up3r9c$3hbk7$10@dont-email.me>
<up47gj$3jfg4$1@dont-email.me>
<87jznu1c4v.fsf@nosuchdomain.example.com>
<up4ceh$3k4b8$1@dont-email.me> <up5fk6$3t99q$6@dont-email.me>
<up5u8c$blo$1@dont-email.me> <up6655$1l8b$2@dont-email.me>
<up6b3v$2ff9$1@dont-email.me> <up8j5h$h743$3@dont-email.me>
<up8rsj$it3f$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="7785f266d7a579ac4bdae19d9302dff6";
logging-data="659781"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18QsxhQNU7CN7cUb8Jx+SKF"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:TQ8gutRZJK4+TGSDPs8kPDVfWk8=
sha1:Un5YbQ3KdlXZP1QN7zrjepMgHI0=
 by: Keith Thompson - Mon, 29 Jan 2024 21:00 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
> On 29/01/2024 16:18, David Brown wrote:
>> On 28/01/2024 20:49, Malcolm McLean wrote:
>>> On 28/01/2024 18:24, David Brown wrote:
>>> I'd expect that most general purpose programs written by Norwegians
>>> use an English interface, even if it isn't really expected that the
>>> program will find an audience beyond some users in Norway. Except
>>> of course for programs which in some way are about Norway.
>> Why?
>>
> Generally programmers are educated people and educated people use
> English for serious purposes. Not always of course and Norway might be
> an exception. But I'd expect that in a Norweigian university, for
> example, it would be forbidden to document a program in Norwegian or
> to use non-English words for identifiers. And probably the same in a
> large Norwegina company. I might be wrong about that and I have never
> visited Norway or worked for a Norweigian employer (and obviously I
> couldn't do so unless the policy I expect was followed).

You assert that "educated people use English for serious purposes".
I don't have the experience to refute that claim, but I suspect
it's arrogant nonsense. I could be wrong, of course.

Even given that assumption, you ignore the possibility that programs
might be intended to be used by non-programmers. You ignore my own
examples of software I've worked on that can be configured to show all
messages in any of several languages, including Norwegian, presumably
because there's a demand for it. And you ignore the statements of
someone who lives in Norway and knows what he's talking about.

Consider not making definitive statements about things you don't know
about.

[...]

--
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: iso646.h

<up97vr$l025$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.furie.org.uk!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: malcolm....@gmail.com (Malcolm McLean)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 22:14:17 +0000
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <up97vr$l025$1@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me>
<uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me> <87frym7l3p.fsf@nosuchdomain.example.com>
<uot08a$278i2$1@dont-email.me> <uotmed$2ack6$2@dont-email.me>
<up17f9$313qt$4@dont-email.me> <up197h$31jct$1@dont-email.me>
<up1t0r$37v5a$4@dont-email.me> <up2mor$3bjgb$1@dont-email.me>
<up2ogd$3bs86$1@dont-email.me> <up3r9c$3hbk7$10@dont-email.me>
<up47gj$3jfg4$1@dont-email.me> <87jznu1c4v.fsf@nosuchdomain.example.com>
<up4ceh$3k4b8$1@dont-email.me> <up5fk6$3t99q$6@dont-email.me>
<up5u8c$blo$1@dont-email.me> <up6655$1l8b$2@dont-email.me>
<up6b3v$2ff9$1@dont-email.me> <86zfwnc34o.fsf@linuxsc.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 29 Jan 2024 22:14:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a4e13c308e4d230e4fb0df9c63c73a92";
logging-data="688197"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1837OumUv1VY4hihMRVc630IgYtvS610Ag="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:W0U0Ma3Bn9eEr2SJzT1oEWT69cA=
Content-Language: en-GB
In-Reply-To: <86zfwnc34o.fsf@linuxsc.com>
 by: Malcolm McLean - Mon, 29 Jan 2024 22:14 UTC

On 29/01/2024 20:10, Tim Rentsch wrote:
> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>
> [...]
>
>> I've never used standard output for binary data.
>> [...] it strikes me as a poor design decision.
>
> How so?
>
Because the output can't be inspected by humans, and because it might
have unusual effects if passed though systems designed to handle
human-readable text. For instance in some systems designed to receive
ASCII text, there is no distinction between the nul byte and "waiting
for next data byte". Obviously this will cause difficuties if the data
is binary.
Also many binary formats can't easily be extended, so you can pass one
image and that's all. Whilst it is possible to devise a text format
which is similar, in practice text formats usually have enough
redundancy to be easily extended.

So it's harder to correct errors, more prone to errors, and harder to
extend.

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

Re: iso646.h

<LAVtN.273458$Wp_8.144284@fx17.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!newsfeed.endofthelinebbs.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx17.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: iso646.h
Newsgroups: comp.lang.c
References: <uokhnk$eiln$1@dont-email.me> <up197h$31jct$1@dont-email.me> <up1t0r$37v5a$4@dont-email.me> <up2mor$3bjgb$1@dont-email.me> <up2ogd$3bs86$1@dont-email.me> <up3r9c$3hbk7$10@dont-email.me> <up47gj$3jfg4$1@dont-email.me> <87jznu1c4v.fsf@nosuchdomain.example.com> <up4ceh$3k4b8$1@dont-email.me> <up5fk6$3t99q$6@dont-email.me> <up5u8c$blo$1@dont-email.me> <up6655$1l8b$2@dont-email.me> <up6b3v$2ff9$1@dont-email.me> <86zfwnc34o.fsf@linuxsc.com> <up97vr$l025$1@dont-email.me>
Lines: 25
Message-ID: <LAVtN.273458$Wp_8.144284@fx17.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Mon, 29 Jan 2024 22:24:43 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Mon, 29 Jan 2024 22:24:43 GMT
X-Received-Bytes: 2037
 by: Scott Lurndal - Mon, 29 Jan 2024 22:24 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>On 29/01/2024 20:10, Tim Rentsch wrote:
>> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>>
>> [...]
>>
>>> I've never used standard output for binary data.
>>> [...] it strikes me as a poor design decision.
>>
>> How so?
> >
>Because the output can't be inspected by humans

Sure it can. Pipe it to a the appropriate tool.

$ cat /usr/bin/xrn | xxd |head
0000000: 7f45 4c46 0201 0100 0000 0000 0000 0000 .ELF............
0000010: 0200 3e00 0100 0000 ac47 4000 0000 0000 ..>......G@.....
0000020: 4000 0000 0000 0000 08a0 0500 0000 0000 @...............
0000030: 0000 0000 4000 3800 0900 4000 2200 1f00 ....@.8...@."...
0000040: 0600 0000 0500 0000 4000 0000 0000 0000 ........@.......
0000050: 4000 4000 0000 0000 4000 4000 0000 0000 @.@.....@.@.....
0000060: f801 0000 0000 0000 f801 0000 0000 0000 ................
0000070: 0800 0000 0000 0000 0300 0000 0400 0000 ................
0000080: 3802 0000 0000 0000 3802 4000 0000 0000 8.......8.@.....

Re: iso646.h

<up98o0$l025$2@dont-email.me>

  copy mid

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

  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....@gmail.com (Malcolm McLean)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 22:27:12 +0000
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <up98o0$l025$2@dont-email.me>
References: <uokhnk$eiln$1@dont-email.me> <uol92t$l82b$3@dont-email.me>
<uomjfr$sopf$1@dont-email.me> <uoopm9$1blvh$1@dont-email.me>
<uop0r1$1d4d4$1@dont-email.me> <uoqvas$1q40p$1@dont-email.me>
<uor4rf$1r10t$1@dont-email.me> <uorolm$1uaut$1@dont-email.me>
<uotnnt$2akq3$1@dont-email.me> <uou1lg$2c9us$1@dont-email.me>
<875xzh43us.fsf@nosuchdomain.example.com> <up07tb$2qm2c$1@dont-email.me>
<up0lab$2u6hl$2@dont-email.me> <up0rth$2vbj2$1@dont-email.me>
<up10ip$305rf$1@dont-email.me> <up1hom$32rbe$1@dont-email.me>
<up1ru6$37v5a$1@dont-email.me> <up2m6r$3bh1b$1@dont-email.me>
<up2nrk$3bnll$1@dont-email.me> <up2prg$3c32r$1@dont-email.me>
<up8qvp$io5t$1@dont-email.me> <up8rtr$ita8$1@dont-email.me>
<20240129112925.302@kylheku.com> <up90o0$jkcu$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 29 Jan 2024 22:27:12 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a4e13c308e4d230e4fb0df9c63c73a92";
logging-data="688197"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+zMRvoCb4CwNSka3tbeS6/VP95N+YLqPw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:y9IaTkczmmEM1X50BbAU1TIEb+4=
Content-Language: en-GB
In-Reply-To: <up90o0$jkcu$2@dont-email.me>
 by: Malcolm McLean - Mon, 29 Jan 2024 22:27 UTC

On 29/01/2024 20:10, David Brown wrote:
> On 29/01/2024 20:35, Kaz Kylheku wrote:
>> On 2024-01-29, David Brown <david.brown@hesbynett.no> wrote:
>>> On 29/01/2024 19:32, Malcolm McLean wrote:
>>>> On 27/01/2024 11:36, Janis Papanagnou wrote:
>>>>> On 27.01.2024 12:02, Malcolm McLean wrote:
>>>>>> On 27/01/2024 10:34, Janis Papanagnou wrote:
>>>>>>> On 27.01.2024 04:05, Malcolm McLean wrote:
>>>
>>>
>>>> In many languages, including C, there's a difference between functions
>>>> that return a value and functions that don't, in that
>>>
>>> In some languages, yes.
>>>
>>>>
>>>> if (realloc(ptr, 0))
>>>>
>>>> is allowed
>>>>
>>>> whilst
>>>>
>>>> if (free(ptr))
>>>
>>> struct S { int a, b; };
>>>
>>> struct S foo(void);
>>>
>>> foo() returns a value, but "if (foo())" is not allowed.
>>>
>>> C does not make much difference between functions that return a value,
>>> and those that don't.  The key distinction is whether the "return"
>>> statement must have an expression or must not have an expression.
>>
>> Don't forget that we can have:
>>
>>    struct S s = foo();
>>
>> not to mention
>>
>>    struct S bar(void) { return foo(); }
>>
>> as well as:
>>
>>    extern bar(struct S);
>>
>>    bar(foo());
>>
>> none of which patterns is possible if foo returns void.
>
> Sure.  But Malcolm suggested that the "if" pattern was a special
> distinguishing feature.  (He has already made it clear that the only
> types of interest, in his world, are integers, floats and strings.)
>
No, Malcolm gave if() as an example of a distinction in a language grammar
between functions that return a value and functions that don't. Sometimes
functions return a value and if() still isn't allowed. Fair enough
point.But it doesn't really detract from the point that Malcolm is makin

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


devel / comp.lang.c / iso646.h

Pages:1234567891011121314151617181920212223242526
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor