Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #401906
| From | Kaz Kylheku <046-301-5902@kylheku.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Trolling the standard thumpers |
| Date | 2026-09-10 20:06 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <20260910110112.37@kylheku.com> (permalink) |
| References | <2qLfS.354537$aXr.31321@fx18.ams4> |
On 2026-08-14, Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> wrote:
> Dear comp.lang.c,
>
> Because I believe the standard thumpers have trolled us quite well
> for way too long, I'm asking quite casually, if this is a conformant
> implementation of printf()?
>
> int printf( const char *format, ... ) {
> errno = ENOTTY ;
> return -1 ;
> }
The proper question is, could an implementation be conforming if that
were its implementation of printf?
Right of the bat, the implementation could be a conforming freestanding
implementation, due to freestanding implementations not being required
to implement stdio.
Could it be a conforming hosted implementation? I'm afraid the answer
is yes, due to the way conformance is defined.
Or, we can look at this another way. Suppose you have a conforming C
implementation on some kind of Unix and make a program that uses printf.
The program is deployed in such a way that its output is redirected to a
device where output operations fail. Surely, that environmental
circumstance does not make the C implementation nonconforming.
The printf function is doing something that is permitted; returning
-1 and setting errno. That cannot be called a nonconforming behavior.
In the standard we have wording like "A conforming hosted
implementation shall accept any strictly conforming program", but
the above definition of printf doesn't hinder acceptance of a program.
E.g. the familiar "hello world" program is not prevented from
being translated or even executed.
Conformance isn't a very useful concept except in the negative: a
nonconformance can cause a problem to a user, requiring a workaround.
It's something that can usually be reported as a bug. But assurances
of conformance have limited value.
--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Trolling the standard thumpers Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-15 05:05 +0800
Re: Trolling the standard thumpers Kaz Kylheku <046-301-5902@kylheku.com> - 2026-09-10 20:06 +0000
Re: Trolling the standard thumpers Lane W <cactus_DAC@yahoo.com> - 2026-09-10 14:14 -0600
Re: Trolling the standard thumpers fir <profesor.fir@gmail.com> - 2026-09-10 22:33 +0200
Re: Trolling the standard thumpers Lane W <cactus_DAC@yahoo.com> - 2026-09-10 15:03 -0600
Re: Trolling the standard thumpers fir <profesor.fir@gmail.com> - 2026-09-11 13:49 +0200
Re: Trolling the standard thumpers fir <profesor.fir@gmail.com> - 2026-09-11 13:55 +0200
Re: Trolling the standard thumpers Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-09-10 14:25 -0700
Re: Trolling the standard thumpers Lane W <cactus_DAC@yahoo.com> - 2026-09-10 15:33 -0600
Re: Trolling the standard thumpers David Brown <david.brown@hesbynett.no> - 2026-09-11 09:37 +0200
Re: Trolling the standard thumpers fir <profesor.fir@gmail.com> - 2026-09-11 14:00 +0200
Re: Trolling the standard thumpers Lane W <cactus_DAC@yahoo.com> - 2026-09-11 07:18 -0600
Re: Trolling the standard thumpers Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-09-18 08:22 -0700
Re: Trolling the standard thumpers BGB <cr88192@gmail.com> - 2026-09-10 15:56 -0500
csiph-web