Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Doubt is not a pleasant condition, but certainty is absurd. -- Voltaire


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

<up9dml$lmi3$3@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 23:51:49 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <up9dml$lmi3$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> <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; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 29 Jan 2024 23:51:49 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ba17ffef95be9ddc6f864a9afa7ca434";
logging-data="711235"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+saVAJIiW5GT0JxSwvbyl"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:fbLbJLvDuTw2AjjPaD86c52PYe0=
 by: Lawrence D'Oliv - Mon, 29 Jan 2024 23:51 UTC

On Mon, 29 Jan 2024 19:33:26 +0100, Janis Papanagnou wrote:

> printf ("%s\n", "My\0string");
>
> which won't work as some may expect (you will only see "My").

I’ve often thought, now that we can assume that strings are normally
UTF-8-encoded, that we can use an alternative UTF-8-derived representation
of NUL that *isn’t* interpreted as a string terminator. E.g.

\xc0\x80

Re: iso646.h

<up9dt4$lmi3$4@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 23:55:16 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <up9dt4$lmi3$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> <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
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 29 Jan 2024 23:55:16 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ba17ffef95be9ddc6f864a9afa7ca434";
logging-data="711235"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19FJu2IlXDqeu5ToMiVzC49"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:0s4BNDeeUi3KyldSdhk6oFI5fvg=
 by: Lawrence D'Oliv - Mon, 29 Jan 2024 23:55 UTC

On Mon, 29 Jan 2024 18:47:46 +0000, Malcolm McLean wrote:

> ... 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.

stderr for debugging, typically, not stdout.

If you want a “human-readable” output stream, stderr would more likely fit
that bill than stdout.

Re: iso646.h

<up9dus$lmi3$5@dont-email.me>

  copy mid

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

  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: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Mon, 29 Jan 2024 23:56:12 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <up9dus$lmi3$5@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> <up8ibt$h743$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 29 Jan 2024 23:56:12 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ba17ffef95be9ddc6f864a9afa7ca434";
logging-data="711235"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182+JqB8ffKN4QESWYj8V2r"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:ZRgQXTfiaNMp2z07hg4PScwWWWQ=
 by: Lawrence D'Oliv - Mon, 29 Jan 2024 23:56 UTC

On Mon, 29 Jan 2024 17:05:17 +0100, David Brown wrote:

> 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%.

If you include them, you find that Microsoft has only something like 25%
of the computer market.

Re: iso646.h

<86il3bb7rb.fsf@linuxsc.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.niel.me!news.gegeweb.eu!gegeweb.org!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 23:27:52 -0800
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <86il3bb7rb.fsf@linuxsc.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> <86zfwnc34o.fsf@linuxsc.com> <up97vr$l025$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="e3f3945cb7164e1654b6d005c9df0f57";
logging-data="953916"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FYd/v6tNZHsF5MZFNyr/6KT/+FUBmr2A="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:NgpRWsgdLjazKdKiHIKJCsTL5j8=
sha1:tZTsZKVeMT0foFLDdClRdS4gnTY=
 by: Tim Rentsch - Tue, 30 Jan 2024 07:27 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, 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. While 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.

Your reasoning is all gobbledygook. Your comments reflect only
limitations in your thinking, not any essential truth about using
standard out for binary data.

Re: iso646.h

<upae4r$tstp$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.hispagatos.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: Tue, 30 Jan 2024 10:05:31 +0100
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <upae4r$tstp$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>
<up98o0$l025$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 30 Jan 2024 09:05:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="320c50a7312db09d065981adb5070632";
logging-data="979897"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19aeGofy9Mx77tEUtN0Ms5DhF2yp8pJayQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:xTfJpd9ajJW/AvHnUh74MUi4bU0=
Content-Language: en-GB
In-Reply-To: <up98o0$l025$2@dont-email.me>
 by: David Brown - Tue, 30 Jan 2024 09:05 UTC

On 29/01/2024 23:27, Malcolm McLean wrote:
> On 29/01/2024 20:10, David Brown wrote:

>> 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
>

Fair enough. But that does not detract from my counter-point - I don't
think void / non-void return type is a major or helpful way to
categorise functions. As you said yourself, there is not a huge
difference between a function that returns a value directly, or one that
takes a pointer for passing the return value to the caller.

And since void / non-void return type is already a distinction made in
the way the code is written, it is not as useful a classification as you
could get from other factors that are not immediately clear from the
code or clear to the compiler (such as "has side-effects" / "depends on
side-effects" / "independent of side-effects", or "thread-safe" / "not
thread-safe").

Re: iso646.h

<upaej6$u5ag$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.swapon.de!news.mixmin.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: Tue, 30 Jan 2024 09:13:07 +0000
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <upaej6$u5ag$1@dont-email.me>
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> <86zfwnc34o.fsf@linuxsc.com>
<up97vr$l025$1@dont-email.me> <86il3bb7rb.fsf@linuxsc.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 30 Jan 2024 09:13:10 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c3e0a6da9f43376c9d7b12b2f973ac5a";
logging-data="988496"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18kVAr4YK06qq7ea7XtiLv+0hMMXpXopHk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:jiRNhMxETgdD+VIEsRjIzrgEcDA=
In-Reply-To: <86il3bb7rb.fsf@linuxsc.com>
Content-Language: en-GB
 by: Malcolm McLean - Tue, 30 Jan 2024 09:13 UTC

On 30/01/2024 07:27, Tim Rentsch wrote:
> 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, 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. While 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.
>
> Your reasoning is all gobbledygook. Your comments reflect only
> limitations in your thinking, not any essential truth about using
> standard out for binary data.
>
I must admit that it's nothing I have ever done or considered doing.

However standard output is designed for text and not binary ouput.
Whilst there is a "printf()" which operates on standard output by
default, there are no functions which write binary data to standard
outout by default, for example. Though of course you can pass stdout to
the regular binary output functions like fwrite().

So I'm obviously not the only person to take the view that passing
binary data to standard output is a rather odd thing to do.

I suspect the truth is that is is a bad design and I am right, but
because for some reason communications have to be via standard output,
people make the best of it and contrive that it shall work, and then
forget that essentially it is a misuse of a text stream. They are
slightly proud of their efforts and intolerant of my point.

That you couldn't actually mount a defence of your position whilst I
could also strongly implies that I am right.
--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

Re: iso646.h

<upas3j$10bft$1@dont-email.me>

  copy mid

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

  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: Tue, 30 Jan 2024 14:03:46 +0100
Organization: A noiseless patient Spider
Lines: 101
Message-ID: <upas3j$10bft$1@dont-email.me>
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> <86zfwnc34o.fsf@linuxsc.com>
<up97vr$l025$1@dont-email.me> <86il3bb7rb.fsf@linuxsc.com>
<upaej6$u5ag$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 30 Jan 2024 13:03:47 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="320c50a7312db09d065981adb5070632";
logging-data="1060349"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19IYMScfXjUew2OvE5iCba2m/8a/3dZIXk="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:zdDAJRAgtsEHBkzArrBtT63km/8=
Content-Language: en-GB
In-Reply-To: <upaej6$u5ag$1@dont-email.me>
 by: David Brown - Tue, 30 Jan 2024 13:03 UTC

On 30/01/2024 10:13, Malcolm McLean wrote:
> On 30/01/2024 07:27, Tim Rentsch wrote:
>> 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, 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.  While 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.
>>
>> Your reasoning is all gobbledygook.  Your comments reflect only
>> limitations in your thinking, not any essential truth about using
>> standard out for binary data.
> >
> I must admit that it's nothing I have ever done or considered doing.
>
> However standard output is designed for text and not binary ouput.

Proof by repeated assertion?

/stderr/ was designed for text - it was for error messages independent
of the main output stream, precisely because stdout output was often not
human readable text but data passed on to other programs or devices.

I wonder if there is any *nix program older or simpler than "cat" - a
program that simply passes its input files or the stdin to stdout.

> Whilst there is a "printf()" which operates on standard output by
> default, there are no functions which write binary data to standard
> outout by default, for example. Though of course you can pass stdout to
> the regular binary output functions like fwrite().

There is no standard C library function that takes stderr as the default
stream. Does that mean stderr was not designed to be used at all?

"printf" exists and works the way it does because it is convenient and
useful. It can be viewed as a short-cut for "fprintf(stdout, ...".
Indeed, that is /exactly/ how the C standard describes the function.

That means the C standards acknowledge that people often want to print
out formatted text (which in no way implies plain ASCII) to stdout.
This does not mean they expect this to be the /only/ use of stdout, or
that people will not use binary outputs to stdout, any more than it
implies that text output will always be sent to stdout and not other
streams or files.

>
> So I'm obviously not the only person to take the view that passing
> binary data to standard output is a rather odd thing to do.

Many programs only write text to stdout. That does not mean writing
binary data is "odd", or that stdout was "designed" for text.

>
> I suspect the truth is that is is a bad design and I am right, but
> because for some reason communications have to be via standard output,
> people make the best of it and contrive that it shall work, and then
> forget that essentially it is a misuse of a text stream. They are
> slightly proud of their efforts and intolerant of my point.
>

Obviously you think you are right - it would be pretty silly for you to
witter on in the face of clear and mostly unanimous opposition if you
did not think you were right. That, of course, does not mean you /are/
right.

> That you couldn't actually mount a defence of your position whilst I
> could also strongly implies that I am right.

He was correct - your reasoning is gobbledygook.

If I claim grass is pink, and I know this because it is the same colour
as the sea which is also pink, then I have given a justification and a
defence of my position. That doesn't mean it is worth the pixels it is
written with, or that anyone needs to elaborate when they same I am
talking nonsense.

It is so blindingly clear and obvious that stdout is regularly used for
non-text data, and so many undeniably accurate and common examples have
been given, that your position is entirely untenable.

Re: iso646.h

<U98uN.131477$q3F7.52171@fx45.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.hispagatos.org!news.nntp4.net!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx45.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> <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> <86il3bb7rb.fsf@linuxsc.com> <upaej6$u5ag$1@dont-email.me>
Lines: 43
Message-ID: <U98uN.131477$q3F7.52171@fx45.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 30 Jan 2024 15:00:04 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 30 Jan 2024 15:00:04 GMT
X-Received-Bytes: 2796
 by: Scott Lurndal - Tue, 30 Jan 2024 15:00 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>On 30/01/2024 07:27, Tim Rentsch wrote:
>> 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, 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. While 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.
>>
>> Your reasoning is all gobbledygook. Your comments reflect only
>> limitations in your thinking, not any essential truth about using
>> standard out for binary data.
> >
>I must admit that it's nothing I have ever done or considered doing.
>
>However standard output is designed for text and not binary ouput.

That was never the case. stdout is a unformatted stream of bytes
associated by default with file descriptor number one in the
application.

Long before windows was even a gleam in gates eye.

Re: iso646.h

<upb44u$11meh$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: malcolm....@gmail.com (Malcolm McLean)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Tue, 30 Jan 2024 15:21:01 +0000
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <upb44u$11meh$1@dont-email.me>
References: <uokhnk$eiln$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>
<86il3bb7rb.fsf@linuxsc.com> <upaej6$u5ag$1@dont-email.me>
<U98uN.131477$q3F7.52171@fx45.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 30 Jan 2024 15:21:02 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="70f232d97e2d1b4cff25c5f882fbcac3";
logging-data="1104337"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19oRNus5fZsFx8KyK+qHYWNBy4ljYIj0Dk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:TdS0QwMTtxu7Nb3Kkrx19Vj8xPw=
In-Reply-To: <U98uN.131477$q3F7.52171@fx45.iad>
Content-Language: en-GB
 by: Malcolm McLean - Tue, 30 Jan 2024 15:21 UTC

On 30/01/2024 15:00, Scott Lurndal wrote:
> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>> On 30/01/2024 07:27, Tim Rentsch wrote:
>>> 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, 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. While 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.
>>>
>>> Your reasoning is all gobbledygook. Your comments reflect only
>>> limitations in your thinking, not any essential truth about using
>>> standard out for binary data.
>>>
>> I must admit that it's nothing I have ever done or considered doing.
>>
>> However standard output is designed for text and not binary ouput.
>
> That was never the case. stdout is a unformatted stream of bytes
> associated by default with file descriptor number one in the
> application.
>
It is a stream of bytes at the level that the file descriptor is used to
generate a write event for a byte which can be arbitrary. But standard
output is often quickly transformed into a stream of characters.
Sometimes within the application executable.
>
> Long before windows was even a gleam in gates eye.
>
Most systems run Windows where the model of piping from standard output
to standard input of the next program is much less used than in Unix,
this is true. That sometimes generates a feeling of superiority amongst
those who use the less common, often more expensive Unix systems. It's
very silly, but that's how people think.

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

Re: iso646.h

<upb4ng$11pmg$1@dont-email.me>

  copy mid

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

  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: Tue, 30 Jan 2024 15:30:57 +0000
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <upb4ng$11pmg$1@dont-email.me>
References: <uokhnk$eiln$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>
<86il3bb7rb.fsf@linuxsc.com> <upaej6$u5ag$1@dont-email.me>
<U98uN.131477$q3F7.52171@fx45.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 30 Jan 2024 15:30:56 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1d628cc0776738c82c53ff623f6818a6";
logging-data="1107664"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18inb1ZH1oMnlkykSRmyLma0CdfVohmnvM="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ZRcSbgychkC85X7u6NhGOBQrniQ=
Content-Language: en-GB
In-Reply-To: <U98uN.131477$q3F7.52171@fx45.iad>
 by: bart - Tue, 30 Jan 2024 15:30 UTC

On 30/01/2024 15:00, Scott Lurndal wrote:
> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:

>> I must admit that it's nothing I have ever done or considered doing.
>>
>> However standard output is designed for text and not binary ouput.
>
> That was never the case. stdout is a unformatted stream of bytes
> associated by default with file descriptor number one in the
> application.
>
> Long before windows was even a gleam in gates eye.
>

I don't know what Windows has to do with it.

The difference between text and binary byte streams is something
invented by C, so that conversions could be done for byte '\n' on
systems with alternate line-endings.

It wasn't just LF versus CRLF either. The difference with the latter is
that it is still use, /due to the popularity/ of MSDOS and WINDOWS,
while others have died out.

With C out of the picture, then CRLF was and is simply a two-byte
sequence: you write two bytes, or read two bytes.

So long as a byte has 8 bits, you can't tell whether a byte stream
represents text or binary data.

When coding however, it seems incredibly bad form to me to send what you
know is binary data (so can contain malformed UTF8, or inadvertent
escape sequences) to an output which will try to represent that on a
text display.

For such reasons, whenever I invent a binary text format, I usually
include a 26/1A byte (end-of-file) so that programs which expect a text
file will stop at that character. For example:

c:\mx>type hello.mx
MCX
c:\mx>dump hello.mx
0000: 4D 43 58 1A 01 30 2E 31 32 33 34 00 05 76 02 00

If I try it under WSL with 'cat', I get a huge bunch of crap displayed
on the screen, mixed up with long beeps whenever there's an 07 byte.

That's why binary code, not representing text, is a bad idea even on
'stdout'.

Re: iso646.h

<upb5q3$11vej$1@dont-email.me>

  copy mid

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

  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: Tue, 30 Jan 2024 15:49:22 +0000
Organization: A noiseless patient Spider
Lines: 61
Message-ID: <upb5q3$11vej$1@dont-email.me>
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> <86zfwnc34o.fsf@linuxsc.com>
<up97vr$l025$1@dont-email.me> <86il3bb7rb.fsf@linuxsc.com>
<upaej6$u5ag$1@dont-email.me> <upas3j$10bft$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 30 Jan 2024 15:49:23 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="70f232d97e2d1b4cff25c5f882fbcac3";
logging-data="1113555"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4/s6pZYRAiUs1Q9KWSBkmiiTZt6DxRf4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:2WclZtv7ihcgJnTYHf+SwVypXr0=
In-Reply-To: <upas3j$10bft$1@dont-email.me>
Content-Language: en-GB
 by: Malcolm McLean - Tue, 30 Jan 2024 15:49 UTC

On 30/01/2024 13:03, David Brown wrote:
> On 30/01/2024 10:13, Malcolm McLean wrote:
>
> There is no standard C library function that takes stderr as the default
> stream.  Does that mean stderr was not designed to be used at all?
>
> "printf" exists and works the way it does because it is convenient and
> useful.  It can be viewed as a short-cut for "fprintf(stdout, ...".
> Indeed, that is /exactly/ how the C standard describes the function.
>
> That means the C standards acknowledge that people often want to print
> out formatted text (which in no way implies plain ASCII) to stdout. This
> does not mean they expect this to be the /only/ use of stdout, or that
> people will not use binary outputs to stdout, any more than it implies
> that text output will always be sent to stdout and not other streams or
> files.
>
Speical facilities for text don't necessarily mean that text is the only
output intended to be used, fair enough.

printf has no binary data format specifier. And as you say, the fact
that it is provided is an acknowledgement that programmers often want to
pass formatted text to standard output. The fact that there is no
similar function for standard error suggests that wanting to pass
formatted text to error is a less common requirement. Which is my
experience for the sort of programming that I do. Similarly there is no
function "write`" that passes binary data to standard output by default.
So this suggests that passing binary data to standard output is a less
common requirement. And in fact on many systems standard output will
corrupt such data by in default mode.

So these three things together - no binary data format specifer for
printf(), no binary equivalent function to printf that defaults to
standard output, and the fact that standard output will corrupt binary
data in default mode on some systems, adds up to a pretty powerful
argument for my position.
>
> If I claim grass is pink, and I know this because it is the same colour
> as the sea which is also pink, then I have given a justification and a
> defence of my position.  That doesn't mean it is worth the pixels it is
> written with, or that anyone needs to elaborate when they same I am
> talking nonsense.
>
> It is so blindingly clear and obvious that stdout is regularly used for
> non-text data, and so many undeniably accurate and common examples have
> been given, that your position is entirely untenable.
>
Do learn to think. I've given coherent, reasonable, justifications that are
open to dispute on their own terms. That you are capable of inventing an
incoherent argument on a different topic proves nothing even by analogy
except, to be fair, that it is plausible that people will make bad
arguments.

And apart from "that's how you have to do it to make a web server work
under Unix", I haven't seen much of anything in this sub thread which
constitutes a good argument for passing binary data to standard output.

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

Re: iso646.h

<AX8uN.374646$p%Mb.262644@fx15.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx15.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> <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> <86il3bb7rb.fsf@linuxsc.com> <upaej6$u5ag$1@dont-email.me> <U98uN.131477$q3F7.52171@fx45.iad> <upb44u$11meh$1@dont-email.me>
Lines: 55
Message-ID: <AX8uN.374646$p%Mb.262644@fx15.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 30 Jan 2024 15:53:04 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 30 Jan 2024 15:53:04 GMT
X-Received-Bytes: 3348
 by: Scott Lurndal - Tue, 30 Jan 2024 15:53 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>On 30/01/2024 15:00, Scott Lurndal wrote:
>> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>>> On 30/01/2024 07:27, Tim Rentsch wrote:
>>>> 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, 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. While 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.
>>>>
>>>> Your reasoning is all gobbledygook. Your comments reflect only
>>>> limitations in your thinking, not any essential truth about using
>>>> standard out for binary data.
>>>>
>>> I must admit that it's nothing I have ever done or considered doing.
>>>
>>> However standard output is designed for text and not binary ouput.
>>
>> That was never the case. stdout is a unformatted stream of bytes
>> associated by default with file descriptor number one in the
>> application.
>>
>It is a stream of bytes at the level that the file descriptor is used to
>generate a write event for a byte which can be arbitrary. But standard
>output is often quickly transformed into a stream of characters.
>Sometimes within the application executable.

It's binary data. UTF-8, for example, is binary data. Your
statement "standard output is designed for text, not binary" is
completely false.

>those who use the less common, often more expensive Unix systems.

More expensive? In what world do you live?

Re: iso646.h

<iZ8uN.374647$p%Mb.202743@fx15.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx15.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> <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> <86il3bb7rb.fsf@linuxsc.com> <upaej6$u5ag$1@dont-email.me> <U98uN.131477$q3F7.52171@fx45.iad> <upb4ng$11pmg$1@dont-email.me>
Lines: 26
Message-ID: <iZ8uN.374647$p%Mb.202743@fx15.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 30 Jan 2024 15:54:54 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 30 Jan 2024 15:54:54 GMT
X-Received-Bytes: 1941
 by: Scott Lurndal - Tue, 30 Jan 2024 15:54 UTC

bart <bc@freeuk.com> writes:
>On 30/01/2024 15:00, Scott Lurndal wrote:
>> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>
>>> I must admit that it's nothing I have ever done or considered doing.
>>>
>>> However standard output is designed for text and not binary ouput.
>>
>> That was never the case. stdout is a unformatted stream of bytes
>> associated by default with file descriptor number one in the
>> application.
>>
>> Long before windows was even a gleam in gates eye.
>>
>
>I don't know what Windows has to do with it.
>
>The difference between text and binary byte streams is something
>invented by C, so that conversions could be done for byte '\n' on
>systems with alternate line-endings.

No, it was invented to support windows CRLF line endings.

Regardless of your digression, stdout is still an unformatted
stream of bytes. Any structure on that stream is imposed
by the -consumer- of those bytes.

Re: iso646.h

<K79uN.374649$p%Mb.218835@fx15.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx15.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> <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> <86il3bb7rb.fsf@linuxsc.com> <upaej6$u5ag$1@dont-email.me> <upas3j$10bft$1@dont-email.me> <upb5q3$11vej$1@dont-email.me>
Lines: 52
Message-ID: <K79uN.374649$p%Mb.218835@fx15.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 30 Jan 2024 16:06:02 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 30 Jan 2024 16:06:02 GMT
X-Received-Bytes: 3086
 by: Scott Lurndal - Tue, 30 Jan 2024 16:06 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>On 30/01/2024 13:03, David Brown wrote:
>> On 30/01/2024 10:13, Malcolm McLean wrote:
>>
>> There is no standard C library function that takes stderr as the default
>> stream.  Does that mean stderr was not designed to be used at all?
>>
>> "printf" exists and works the way it does because it is convenient and
>> useful.  It can be viewed as a short-cut for "fprintf(stdout, ...".
>> Indeed, that is /exactly/ how the C standard describes the function.
>>
>> That means the C standards acknowledge that people often want to print
>> out formatted text (which in no way implies plain ASCII) to stdout. This
>> does not mean they expect this to be the /only/ use of stdout, or that
>> people will not use binary outputs to stdout, any more than it implies
>> that text output will always be sent to stdout and not other streams or
>> files.
>>
>Speical facilities for text don't necessarily mean that text is the only
>output intended to be used, fair enough.

Even text is just an unformatted stream of bytes. It is the ultimate
consumer of that text that imposed structure on it (e.g. by treating
it as ASCII, UTF-16, UTF-8, UTF-32, EBCDIC, et cetera, et alia, und so weiter)

>
>printf has no binary data format specifier.

%s? Simply copies non-nul bytes. That's almost as binary as
one can get, it certainly isn't restricted to printable characters.

And of course, there are putc and putchar.

Not to mention using printf where the format string argument
includes binary data.

<snip>
> The fact that there is no
>similar function for standard error

fprintf(stderr, "%s", binary_data_with_no_embedded_nul_bytes);

>. Similarly there is no
>function "write`" that passes binary data to standard output by default.

In the real world, and in the world the C was created to support
there are several functions (write, pwrite, mmap, aio_listio, aio_read,
aio_write et cetera, et alia, und so wieter).

Most of which existed before 1989.

Re: iso646.h

<upb714$12694$1@dont-email.me>

  copy mid

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

  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: Tue, 30 Jan 2024 16:10:13 +0000
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <upb714$12694$1@dont-email.me>
References: <uokhnk$eiln$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> <86il3bb7rb.fsf@linuxsc.com>
<upaej6$u5ag$1@dont-email.me> <U98uN.131477$q3F7.52171@fx45.iad>
<upb4ng$11pmg$1@dont-email.me> <iZ8uN.374647$p%Mb.202743@fx15.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 30 Jan 2024 16:10:12 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1d628cc0776738c82c53ff623f6818a6";
logging-data="1120548"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/LSkgAAFo95FjTP1ZhHDV5cp+p9fzu3UA="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:w0U4rWpiVG1QokCxylJ2cWw/dPI=
Content-Language: en-GB
In-Reply-To: <iZ8uN.374647$p%Mb.202743@fx15.iad>
 by: bart - Tue, 30 Jan 2024 16:10 UTC

On 30/01/2024 15:54, Scott Lurndal wrote:
> bart <bc@freeuk.com> writes:
>> On 30/01/2024 15:00, Scott Lurndal wrote:
>>> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>>
>>>> I must admit that it's nothing I have ever done or considered doing.
>>>>
>>>> However standard output is designed for text and not binary ouput.
>>>
>>> That was never the case. stdout is a unformatted stream of bytes
>>> associated by default with file descriptor number one in the
>>> application.
>>>
>>> Long before windows was even a gleam in gates eye.
>>>
>>
>> I don't know what Windows has to do with it.
>>
>> The difference between text and binary byte streams is something
>> invented by C, so that conversions could be done for byte '\n' on
>> systems with alternate line-endings.
>
> No, it was invented to support windows CRLF line endings.

You just want to have a go at Windows don't you?

I was using CRLF line-endings in 1970s, they weren't an invention of
Windows, which didn't exist until the mid-80s and didn't become popular
until the mid-90s.

So, how did C deal with CRLF in all those non-Windows settings?

> Regardless of your digression, stdout is still an unformatted
> stream of bytes. Any structure on that stream is imposed
> by the -consumer- of those bytes.

Of course. But it still a bad idea to write actual output that you KNOW
does not represent text, to a consumer that will expect text.

For example to a terminal window, which can happen if you forget to
redirect it.

Re: iso646.h

<upb74m$111js$1@dont-email.me>

  copy mid

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

  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: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.lang.c
Subject: Re: iso646.h
Date: Tue, 30 Jan 2024 16:12:06 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 69
Message-ID: <upb74m$111js$1@dont-email.me>
References: <uokhnk$eiln$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>
<86il3bb7rb.fsf@linuxsc.com> <upaej6$u5ag$1@dont-email.me>
<upas3j$10bft$1@dont-email.me> <upb5q3$11vej$1@dont-email.me>
<K79uN.374649$p%Mb.218835@fx15.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 30 Jan 2024 16:12:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3058a5c6055200c7cb8c318a8eb36e31";
logging-data="1083004"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+STZxmsqU7tZlwafAQvUNOsVnzGKQ9qBk="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:uwNcjsqSxQoCOeg1MGIdwv/UHm8=
 by: Lew Pitcher - Tue, 30 Jan 2024 16:12 UTC

On Tue, 30 Jan 2024 16:06:02 +0000, Scott Lurndal wrote:

> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>>On 30/01/2024 13:03, David Brown wrote:
>>> On 30/01/2024 10:13, Malcolm McLean wrote:
>>>
>>> There is no standard C library function that takes stderr as the default
>>> stream.  Does that mean stderr was not designed to be used at all?
>>>
>>> "printf" exists and works the way it does because it is convenient and
>>> useful.  It can be viewed as a short-cut for "fprintf(stdout, ...".
>>> Indeed, that is /exactly/ how the C standard describes the function.
>>>
>>> That means the C standards acknowledge that people often want to print
>>> out formatted text (which in no way implies plain ASCII) to stdout. This
>>> does not mean they expect this to be the /only/ use of stdout, or that
>>> people will not use binary outputs to stdout, any more than it implies
>>> that text output will always be sent to stdout and not other streams or
>>> files.
>>>
>>Speical facilities for text don't necessarily mean that text is the only
>>output intended to be used, fair enough.
>
> Even text is just an unformatted stream of bytes. It is the ultimate
> consumer of that text that imposed structure on it (e.g. by treating
> it as ASCII, UTF-16, UTF-8, UTF-32, EBCDIC, et cetera, et alia, und so weiter)
>
>>
>>printf has no binary data format specifier.
>
> %s? Simply copies non-nul bytes. That's almost as binary as
> one can get, it certainly isn't restricted to printable characters.
>
> And of course, there are putc and putchar.
>
> Not to mention using printf where the format string argument
> includes binary data.
>
> <snip>
>> The fact that there is no
>>similar function for standard error
>
> fprintf(stderr, "%s", binary_data_with_no_embedded_nul_bytes);

Or, better yet, fwrite(), which can write to any output stream[1],
including stdout and stderr.

[1] At least, the C standard does not impose any restriction on
which stream(s) fwrite() can access, other than that they must
be writable.

>
>>. Similarly there is no
>>function "write`" that passes binary data to standard output by default.

fwrite(buffer,sizeof *buffer,1,stdout);

> In the real world, and in the world the C was created to support
> there are several functions (write, pwrite, mmap, aio_listio, aio_read,
> aio_write et cetera, et alia, und so wieter).
>
> Most of which existed before 1989.

--
Lew Pitcher
"In Skills We Trust"

Re: iso646.h

<upb7ts$12b6n$1@dont-email.me>

  copy mid

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

  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: Tue, 30 Jan 2024 17:25:31 +0100
Organization: A noiseless patient Spider
Lines: 104
Message-ID: <upb7ts$12b6n$1@dont-email.me>
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> <86zfwnc34o.fsf@linuxsc.com>
<up97vr$l025$1@dont-email.me> <86il3bb7rb.fsf@linuxsc.com>
<upaej6$u5ag$1@dont-email.me> <upas3j$10bft$1@dont-email.me>
<upb5q3$11vej$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 30 Jan 2024 16:25:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="320c50a7312db09d065981adb5070632";
logging-data="1125591"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+t/wziHP74qSTZcYPf5jy/DMRj7Nd1/UQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:10eNEtqxpPDinMqmqAdXPtz+LYc=
In-Reply-To: <upb5q3$11vej$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Tue, 30 Jan 2024 16:25 UTC

On 30/01/2024 16:49, Malcolm McLean wrote:
> On 30/01/2024 13:03, David Brown wrote:
>> On 30/01/2024 10:13, Malcolm McLean wrote:
>>
>> There is no standard C library function that takes stderr as the
>> default stream.  Does that mean stderr was not designed to be used at
>> all?
>>
>> "printf" exists and works the way it does because it is convenient and
>> useful.  It can be viewed as a short-cut for "fprintf(stdout, ...".
>> Indeed, that is /exactly/ how the C standard describes the function.
>>
>> That means the C standards acknowledge that people often want to print
>> out formatted text (which in no way implies plain ASCII) to stdout.
>> This does not mean they expect this to be the /only/ use of stdout, or
>> that people will not use binary outputs to stdout, any more than it
>> implies that text output will always be sent to stdout and not other
>> streams or files.
>>
> Speical facilities for text don't necessarily mean that text is the only
> output intended to be used, fair enough.
>
> printf has no binary data format specifier.

Mixing binary data with formatted text data is very unlikely to be
useful. fwrite() is perfectly good for writing binary data - it would
make no sense to have some awkward printf specifier to do this. (What
would the specifier even be? It would need to take two items of data -
a pointer and a length - and thus be very different from existing
specifiers.)

> And as you say, the fact
> that it is provided is an acknowledgement that programmers often want to
> pass formatted text to standard output.

Yes.

> The fact that there is no
> similar function for standard error suggests that wanting to pass
> formatted text to error is a less common requirement.

stderr is a newer invention than stdout and stdin. Perhaps no one
bothered to add such a function to the standard library because
"fprintf(stderr..." is not particularly difficult to write.

> Which is my
> experience for the sort of programming that I do. Similarly there is no
> function "write`" that passes binary data to standard output by default.

What would that gain? One fewer parameters to fwrite() ?

You are reading /way/ too much into the existence or non-existence of
short-cut functions in the C standard library.

> So this suggests that passing binary data to standard output is a less
> common requirement. And in fact on many systems standard output will
> corrupt such data by in default mode.
>
> So these three things together - no binary data format specifer for
> printf(), no binary equivalent function to printf that defaults to
> standard output, and the fact that standard output will corrupt binary
> data in default mode on some systems, adds up to a pretty powerful
> argument for my position.
>>
>> If I claim grass is pink, and I know this because it is the same
>> colour as the sea which is also pink, then I have given a
>> justification and a defence of my position.  That doesn't mean it is
>> worth the pixels it is written with, or that anyone needs to elaborate
>> when they same I am talking nonsense.
>>
>> It is so blindingly clear and obvious that stdout is regularly used
>> for non-text data, and so many undeniably accurate and common examples
>> have been given, that your position is entirely untenable.
>>
> Do learn to think. I've given coherent, reasonable, justifications that are
> open to dispute on their own terms.

No, you haven't. You have taken your own experience of C programming in
a limited niche field, and extrapolated wildly to assume it applies to
all C programming. You have totally failed to consider extremely common
cases where binary stdout output is used - utility programs that anyone
who uses the Linux command line regularly makes use of dozens of times a
day. You have taken the existence or non-existence of certain standard
C library functions as though they were hard rules about how stdout was
"designed", or hard rules about what is "normal" and what is "odd" in C
programming.

Nothing of that was reasonable or justified.

> That you are capable of inventing an
> incoherent argument on a different topic proves nothing even by analogy
> except, to be fair, that it is plausible that people will make bad
> arguments.
>
> And apart from "that's how you have to do it to make a web server work
> under Unix", I haven't seen much of anything in this sub thread which
> constitutes a good argument for passing binary data to standard output.
>

Then you haven't bothered looking at any of the posts in this thread
branch, and it is therefore not worth trying to educate you by repeating
the same things.

Re: iso646.h

<upb8c8$12do6$1@dont-email.me>

  copy mid

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

  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: Tue, 30 Jan 2024 16:33:11 +0000
Organization: A noiseless patient Spider
Lines: 69
Message-ID: <upb8c8$12do6$1@dont-email.me>
References: <uokhnk$eiln$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>
<86il3bb7rb.fsf@linuxsc.com> <upaej6$u5ag$1@dont-email.me>
<upas3j$10bft$1@dont-email.me> <upb5q3$11vej$1@dont-email.me>
<K79uN.374649$p%Mb.218835@fx15.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 30 Jan 2024 16:33:12 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="70f232d97e2d1b4cff25c5f882fbcac3";
logging-data="1128198"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186cNUfhuiNcRn7yb5aABcmNeToCQu/eyI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:dSJh8aHQ/EYCxPp1ypWnmWSvXho=
In-Reply-To: <K79uN.374649$p%Mb.218835@fx15.iad>
Content-Language: en-GB
 by: Malcolm McLean - Tue, 30 Jan 2024 16:33 UTC

On 30/01/2024 16:06, Scott Lurndal wrote:
> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>> On 30/01/2024 13:03, David Brown wrote:
>>> On 30/01/2024 10:13, Malcolm McLean wrote:
>>>
>>> There is no standard C library function that takes stderr as the default
>>> stream.  Does that mean stderr was not designed to be used at all?
>>>
>>> "printf" exists and works the way it does because it is convenient and
>>> useful.  It can be viewed as a short-cut for "fprintf(stdout, ...".
>>> Indeed, that is /exactly/ how the C standard describes the function.
>>>
>>> That means the C standards acknowledge that people often want to print
>>> out formatted text (which in no way implies plain ASCII) to stdout. This
>>> does not mean they expect this to be the /only/ use of stdout, or that
>>> people will not use binary outputs to stdout, any more than it implies
>>> that text output will always be sent to stdout and not other streams or
>>> files.
>>>
>> Speical facilities for text don't necessarily mean that text is the only
>> output intended to be used, fair enough.
>
> Even text is just an unformatted stream of bytes. It is the ultimate
> consumer of that text that imposed structure on it (e.g. by treating
> it as ASCII, UTF-16, UTF-8, UTF-32, EBCDIC, et cetera, et alia, und so weiter)
>
No. If we know that text is ASCII it is not highly structured. But it is
not true that there is no structure and any value can occur in any
position as with true binary data.

>>
>> printf has no binary data format specifier.
>
> %s? Simply copies non-nul bytes. That's almost as binary as
> one can get, it certainly isn't restricted to printable characters.
>
C plays fast and loose with the char type. But you can't pass embedded
nuls. These are so common in binary data that in practis=ce you can't
use %s for binary data at all.
>
> And of course, there are putc and putchar.
>
putc doesn't write by default to standard output. But putchar is a
counter-example, and finally someone has made something which
constitutres a point. But look at the name. "put char". Does that sound
like a function intended for binary or text data? But C plays fast and
loose with character data, and you do have a point here.
>
> Not to mention using printf where the format string argument
> includes binary data.
>
Well OK. That is a way of defeating printf(). But again, how would you
embed a nul byte?
>
> In the real world, and in the world the C was created to support
> there are several functions (write, pwrite, mmap, aio_listio, aio_read,
> aio_write et cetera, et alia, und so wieter).
>
> Most of which existed before 1989.
>
I don't think any of those write binary output by default to standard
output. Some of them take a file descriptor which can be standard output.
Then obviously at a very low level, interfaces tend to be binary. The
ultimate physical reality is usually electronic signals which can take
one of two values. That's not we're talking about.
--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

Re: iso646.h

<upb9bm$12ht9$1@dont-email.me>

  copy mid

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

  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: Tue, 30 Jan 2024 17:49:57 +0100
Organization: A noiseless patient Spider
Lines: 86
Message-ID: <upb9bm$12ht9$1@dont-email.me>
References: <uokhnk$eiln$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> <86il3bb7rb.fsf@linuxsc.com>
<upaej6$u5ag$1@dont-email.me> <U98uN.131477$q3F7.52171@fx45.iad>
<upb4ng$11pmg$1@dont-email.me> <iZ8uN.374647$p%Mb.202743@fx15.iad>
<upb714$12694$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 30 Jan 2024 16:49:58 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="320c50a7312db09d065981adb5070632";
logging-data="1132457"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+RDNbTZfFu5bt+wGF0uDqWN9zzAnIIHpc="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:5IxZzK4qXe6Ia5zML2XhEdalUUA=
In-Reply-To: <upb714$12694$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Tue, 30 Jan 2024 16:49 UTC

On 30/01/2024 17:10, bart wrote:
> On 30/01/2024 15:54, Scott Lurndal wrote:
>> bart <bc@freeuk.com> writes:
>>> On 30/01/2024 15:00, Scott Lurndal wrote:
>>>> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>>>
>>>>> I must admit that it's nothing I have ever done or considered doing.
>>>>>
>>>>> However standard output is designed for text and not binary ouput.
>>>>
>>>> That was never the case.  stdout is a unformatted stream of bytes
>>>> associated by default with file descriptor number one in the
>>>> application.
>>>>
>>>> Long before windows was even a gleam in gates eye.
>>>>
>>>
>>> I don't know what Windows has to do with it.
>>>
>>> The difference between text and binary byte streams is something
>>> invented by C, so that conversions could be done for byte '\n' on
>>> systems with alternate line-endings.
>>
>> No, it was invented to support windows CRLF line endings.
>
> You just want to have a go at Windows don't you?
>
> I was using CRLF line-endings in 1970s, they weren't an invention of
> Windows, which didn't exist until the mid-80s and didn't become popular
> until the mid-90s.

CRLF line endings were the invention of printers or teletype machines.
It took time to move print heads from the end of one line to the
beginning of the next, and separating the "carriage return" and "line
feed" commands made timings easier. It also let printer implementers
handle the two operations independently - occasionally people would want
to do one but not the other.

The use of CRLF as a standard for line endings in files was, I believe,
from CP/M - which came after Unix and Multics, which had standardised on
LF line endings. (Most OS's before that made things up as they choose,
rather than being "standard", or used record-based files, punched cards,
etc.)

So CRLF precedes Windows quite significantly.

(I have no idea why Macs picked CR - perhaps they just wanted to be
different.)

>
> So, how did C deal with CRLF in all those non-Windows settings?
>

The difference between "text" and "binary" streams in C is, in practice,
up to the implementation. That can be the implementation of the C
library, or the OS functions (or DLLs/SOs) that the C library calls.
The norm is that you use "\n" for line endings in the C code - what
happens after that, for text streams, is beyond C.

The reason C distinguishes between text and binary streams is that some
OS's distinguish between them.

>
>> Regardless of your digression, stdout is still an unformatted
>> stream of bytes.   Any structure on that stream is imposed
>> by the -consumer- of those bytes.
>
> Of course. But it still a bad idea to write actual output that you KNOW
> does not represent text, to a consumer that will expect text.
>

That's just a specific example of "it's a bad idea for a program to
behave in a way that a reasonable user would not expect". Which is, of
course, true - but not a big surprise.

> For example to a terminal window, which can happen if you forget to
> redirect it.

If the program can reasonably be expected to generate binary output,
then it is the user's fault if they do this accidentally. Examples
shown in this thread include cat and zcat - that's what these programs do.

Sometimes people make mistakes, and try to "cat" (or "type") non-text
files. Mistakes happen.

Re: iso646.h

<AR9uN.374650$p%Mb.268277@fx15.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!tncsrv06.tnetconsulting.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx15.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> <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> <86il3bb7rb.fsf@linuxsc.com> <upaej6$u5ag$1@dont-email.me> <upas3j$10bft$1@dont-email.me> <upb5q3$11vej$1@dont-email.me> <K79uN.374649$p%Mb.218835@fx15.iad> <upb8c8$12do6$1@dont-email.me>
Lines: 30
Message-ID: <AR9uN.374650$p%Mb.268277@fx15.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 30 Jan 2024 16:54:56 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 30 Jan 2024 16:54:56 GMT
X-Received-Bytes: 2509
 by: Scott Lurndal - Tue, 30 Jan 2024 16:54 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>On 30/01/2024 16:06, Scott Lurndal wrote:
>> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>>> On 30/01/2024 13:03, David Brown wrote:
>>>> On 30/01/2024 10:13, Malcolm McLean wrote:
>>>>
>>>> There is no standard C library function that takes stderr as the default
>>>> stream.  Does that mean stderr was not designed to be used at all?
>>>>
>>>> "printf" exists and works the way it does because it is convenient and
>>>> useful.  It can be viewed as a short-cut for "fprintf(stdout, ...".
>>>> Indeed, that is /exactly/ how the C standard describes the function.
>>>>
>>>> That means the C standards acknowledge that people often want to print
>>>> out formatted text (which in no way implies plain ASCII) to stdout. This
>>>> does not mean they expect this to be the /only/ use of stdout, or that
>>>> people will not use binary outputs to stdout, any more than it implies
>>>> that text output will always be sent to stdout and not other streams or
>>>> files.
>>>>
>>> Speical facilities for text don't necessarily mean that text is the only
>>> output intended to be used, fair enough.
>>
>> Even text is just an unformatted stream of bytes. It is the ultimate
>> consumer of that text that imposed structure on it (e.g. by treating
>> it as ASCII, UTF-16, UTF-8, UTF-32, EBCDIC, et cetera, et alia, und so weiter)
>>
>No. If we know that text is ASCII it is not highly structured.

ASCII is, of course, structured.

Re: iso646.h

<9S9uN.374651$p%Mb.321185@fx15.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx15.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> <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> <86il3bb7rb.fsf@linuxsc.com> <upaej6$u5ag$1@dont-email.me> <upas3j$10bft$1@dont-email.me> <upb5q3$11vej$1@dont-email.me> <upb7ts$12b6n$1@dont-email.me>
Lines: 11
Message-ID: <9S9uN.374651$p%Mb.321185@fx15.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 30 Jan 2024 16:55:33 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 30 Jan 2024 16:55:33 GMT
X-Received-Bytes: 1337
 by: Scott Lurndal - Tue, 30 Jan 2024 16:55 UTC

David Brown <david.brown@hesbynett.no> writes:
>On 30/01/2024 16:49, Malcolm McLean wrote:
>
>> The fact that there is no
>> similar function for standard error suggests that wanting to pass
>> formatted text to error is a less common requirement.
>
>stderr is a newer invention than stdout and stdin.

c'est what?

Re: iso646.h

<upbbuh$12vui$1@dont-email.me>

  copy mid

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

  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: Tue, 30 Jan 2024 17:34:09 +0000
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <upbbuh$12vui$1@dont-email.me>
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> <86zfwnc34o.fsf@linuxsc.com>
<up97vr$l025$1@dont-email.me> <86il3bb7rb.fsf@linuxsc.com>
<upaej6$u5ag$1@dont-email.me> <upas3j$10bft$1@dont-email.me>
<upb5q3$11vej$1@dont-email.me> <upb7ts$12b6n$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 30 Jan 2024 17:34:09 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="70f232d97e2d1b4cff25c5f882fbcac3";
logging-data="1146834"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ieYVzxId/auGxoeqyuz8eW8ne6K2LvyE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:JRb64q9UGmWQ56UUtTsUfIC5TwU=
Content-Language: en-GB
In-Reply-To: <upb7ts$12b6n$1@dont-email.me>
 by: Malcolm McLean - Tue, 30 Jan 2024 17:34 UTC

On 30/01/2024 16:25, David Brown wrote:
> On 30/01/2024 16:49, Malcolm McLean wrote:
>>
>> Which is my experience for the sort of programming that I do.
[stderr less used than stdout]
>> Similarly there is no function "write`" that passes binary data to
>> standard output by default.
>
> What would that gain?  One fewer parameters to fwrite() ?
>
Yes. printf() could easily have been omitted and fprintf() only
provided. But because putting text on standard output is such a common
requirement, it's worth incuding it in the standard library. Purely to
save the file stream parameter. Binary output to standard output, not
used enough to be worth doing this.
--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

Creation era of stdin, stdout, stderr (was Re: iso646.h)

<upbdqd$13cnt$1@dont-email.me>

  copy mid

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

  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: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.c
Subject: Creation era of stdin, stdout, stderr (was Re: iso646.h)
Date: Tue, 30 Jan 2024 19:06:04 +0100
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <upbdqd$13cnt$1@dont-email.me>
References: <uokhnk$eiln$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> <86il3bb7rb.fsf@linuxsc.com>
<upaej6$u5ag$1@dont-email.me> <upas3j$10bft$1@dont-email.me>
<upb5q3$11vej$1@dont-email.me> <upb7ts$12b6n$1@dont-email.me>
<9S9uN.374651$p%Mb.321185@fx15.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 30 Jan 2024 18:06:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="365e70677ef6a1990a5605d33fc78114";
logging-data="1159933"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+SdJbcTDoQda3iRtn8d6Zp"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:by1Hhl3VNemybowG4ORxEWWTp1k=
In-Reply-To: <9S9uN.374651$p%Mb.321185@fx15.iad>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Tue, 30 Jan 2024 18:06 UTC

On 30.01.2024 17:55, Scott Lurndal wrote:
> David Brown <david.brown@hesbynett.no> writes:
>>
>> stderr is a newer invention than stdout and stdin.
>
> c'est what?
>

(The posting frequency is amazing, and many texts
filled with countless crude and hilarious claims;
it would take too much time to answer them all.)[*]

What we certainly know for sure is...

All these channels are about 6000 years old.[**]

On the eighth day The Lord gave us stdin(0),
thus we were able to receive divine wisdom.
On the ninth day The Lord gave us stdout(1),
thus we could praise him for the wisdom he gave us.
But The Lord saw that it was not good.
So on the tenth day The Lord gave us stderr(2),
and thus we further knew that we are erring.

This apocryphal text undoubtedly proves what yet
had been only unproven claims.

Janis

[*] See also: https://xkcd.com/386/

[**] Some say that must be a fixed point number,
and it's effectively 60,00 years (or 60.00 in US
format). But anyway, "The Word" is what counts.

Re: iso646.h

<upbepv$13i7k$1@dont-email.me>

  copy mid

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

  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: Tue, 30 Jan 2024 18:22:56 +0000
Organization: A noiseless patient Spider
Lines: 137
Message-ID: <upbepv$13i7k$1@dont-email.me>
References: <uokhnk$eiln$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> <86il3bb7rb.fsf@linuxsc.com>
<upaej6$u5ag$1@dont-email.me> <U98uN.131477$q3F7.52171@fx45.iad>
<upb4ng$11pmg$1@dont-email.me> <iZ8uN.374647$p%Mb.202743@fx15.iad>
<upb714$12694$1@dont-email.me> <upb9bm$12ht9$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 30 Jan 2024 18:22:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1d628cc0776738c82c53ff623f6818a6";
logging-data="1165556"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yKVJ6eXc1WvrmpB++n3lWHATq0XanPKs="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:UreBQvYde8kg58/2GeRe7kxzRQE=
In-Reply-To: <upb9bm$12ht9$1@dont-email.me>
Content-Language: en-GB
 by: bart - Tue, 30 Jan 2024 18:22 UTC

On 30/01/2024 16:49, David Brown wrote:

>> You just want to have a go at Windows don't you?
>>
>> I was using CRLF line-endings in 1970s, they weren't an invention of
>> Windows, which didn't exist until the mid-80s and didn't become
>> popular until the mid-90s.
>
> CRLF line endings were the invention of printers or teletype machines.
> It took time to move print heads from the end of one line to the
> beginning of the next, and separating the "carriage return" and "line
> feed" commands made timings easier.  It also let printer implementers
> handle the two operations independently - occasionally people would want
> to do one but not the other.
>
> The use of CRLF as a standard for line endings in files was, I believe,
> from CP/M - which came after Unix and Multics, which had standardised on
> LF line endings.  (Most OS's before that made things up as they choose,
> rather than being "standard", or used record-based files, punched cards,
> etc.)
>
> So CRLF precedes Windows quite significantly.
>
> (I have no idea why Macs picked CR - perhaps they just wanted to be
> different.)
>
>>
>> So, how did C deal with CRLF in all those non-Windows settings?
>>
>
> The difference between "text" and "binary" streams in C is, in practice,
> up to the implementation.  That can be the implementation of the C
> library, or the OS functions (or DLLs/SOs) that the C library calls. The
> norm is that you use "\n" for line endings in the C code - what happens
> after that, for text streams, is beyond C.
>
> The reason C distinguishes between text and binary streams is that some
> OS's distinguish between them.
>
>>
>>> Regardless of your digression, stdout is still an unformatted
>>> stream of bytes.   Any structure on that stream is imposed
>>> by the -consumer- of those bytes.
>>
>> Of course. But it still a bad idea to write actual output that you
>> KNOW does not represent text, to a consumer that will expect text.
>>
>
> That's just a specific example of "it's a bad idea for a program to
> behave in a way that a reasonable user would not expect".  Which is, of
> course, true - but not a big surprise.
>
>> For example to a terminal window, which can happen if you forget to
>> redirect it.
>
> If the program can reasonably be expected to generate binary output,
> then it is the user's fault if they do this accidentally.  Examples
> shown in this thread include cat and zcat - that's what these programs do.
>
> Sometimes people make mistakes, and try to "cat" (or "type") non-text
> files.  Mistakes happen.

If you routinely write pure binary data to stdout, then users are going
to see garbage a lot more often.

I gave an example earlier when displaying a binary file with 'type' was
better-behaved than with 'cat', since 'type' stops at the first 1A byte.

I used this in my binary formats by adding 1A after the signature, so
you if you attempted to type it out, it wouldn't go mad. Here's another
example:

c:\sc>type tree.scd
SCD

(.scd is a binary file containing CAD drawing data.)

If I again do that with 'cat' under WSL, it's goes even crazier. In
starts to try and interpret of the output as commands (with what
program, I don't know), with lots of Bell sounds, and I can't get back
to the WSL prompt.

It's just very, very sloppy.

Using 'type' on a binary file without a 1A deliberately added as a
barrier, can have similar problems, but it will at least stop when 1A is
seen. For example:

c:\jpeg>type card2.jpg
����JFIFHH���ExifMn

I get one line of output. What does 'cat' do? I haven't yet tried it.
Now that I do, then yep, a bunch of crap disappearing off the top of the
screen.

This is the last part of it:

-----------------------------
root@XXX:/mnt/c/jpeg# cat card2.jpg
.....
��Ny�6��G�W������o���N#qi=�>�˧5+_�,�l������*�����}����3Tg�sd����J�&��{��^7��x)j��\�`�BAFxk6k{K���_�>
>�͚͞�O��
��{J}bT��Nl��Y�ث���:����#�jƾ�`T�s
$�b��Y�Lث��root@XXX:/mnt/c/jpeg# 61;6;7;22;23
3;24;28;32;42c
61: command not found
6: command not found
7: command not found
22: command not found
23: command not found
24: command not found
28: command not found
32: command not found

Command '42c' not found, did you mean:

command 'g2c' from deb goo (0.155+ds-1)
command 'f2c' from deb f2c (20160102-1)

Try: apt install <deb name>

root@XXX:/mnt/c/jpeg#

------------------------------------

It stopped a third of the way down showing ... 24;28;32;42c (I didn't
notice the prompt that was hidden in there), then I typed Enter, which
generated that other garbage.

This is really poor. I know you will not agree with that; you can't do
as you would then be against the entire ethos of Unix which is that
everything is done by piping binary data between processes.

Re: iso646.h

<upbf5t$13jss$1@dont-email.me>

  copy mid

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

  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: Tue, 30 Jan 2024 18:29:16 +0000
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <upbf5t$13jss$1@dont-email.me>
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> <87sf2f6eip.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 30 Jan 2024 18:29:17 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="70f232d97e2d1b4cff25c5f882fbcac3";
logging-data="1167260"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18RaDWqxvPw00AqvOFTVy1GvCyIub8yCS0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:FKV0sFfZn1jpa9qYrsk6UsXiIj4=
Content-Language: en-GB
In-Reply-To: <87sf2f6eip.fsf@nosuchdomain.example.com>
 by: Malcolm McLean - Tue, 30 Jan 2024 18:29 UTC

On 29/01/2024 21:00, Keith Thompson wrote:
> 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.

Everything which is at all intellectually serious is these days written
in English. It's the new Latin. It's the language all educated people
use to communicate with each other when discussing scientific,
philosophical, or scholarly matters. And also technical matters to a
large extent.
There are a few exceptions but very few. I remember a discussion about
whether you could get away with organising a scientific conference in
French, in France, and the conclusion was that you could not. Even in
France. However the French are very reluctant to concede, which is why
the discussion took place at all.

If a large Norwegian company allows programmers to document software in
Norwegian, then it cannot employ non-Norwegian programmers to work on
it. So I would imagine that this would be forbidden, But I've never
actually worked for a Norwegian company and I don't actually know. David
Brown, to be fair, does work for a Norwegian company so he might know
better. But he asks "why?" and I gave the reason.

--
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