Stephen Sprunk said:
The _running_ kernel is arguably part of the implementation;
You mean it's arguably part of _an_ implementation. I will
take up this question further on.
the kernel _source being compiled_ is not.
The Linux kernel is only expected to be compilable by GCC,
Doesn't change my point, since GCC runs on systems besides
Linux.
and successfully compiling the Linux kernel is a gate in the
GCC release process, so the two are intimately tied together.
That doesn't make Linux part of a gcc implementation, any more
than a requirement for a successful compilation of 'rogue' would
make 'rogue' part of gcc implementations.
I would expect the same of Windows and MSVC, etc. Kernels are
special.
Kernels generally are more dependent on their compilation
environment than other programs. From a compiler's point
of view though they are still just programs.
In such a case, the normal rules are simply not relevant.
The rules are relevant precisely because the kernel must
ensure that the rules it chooses to violate won't be
messed up by any implementation-reserved decisions made
by the compiler in question. If the kernel didn't break
any rules, then it wouldn't matter which compiler is
used to compile it; it's because the kernel _does_ break
rules that it needs to be choosy about which compilers
it uses. What I think you mean is that, because the
kernel is compiled with a compiler that doesn't exhibit
destructive interference over the rules the kernel does
break, breaking those rules does not have any negative
effects; and certainly that is true (by definition
it would have to be).
OTOH, that also means that one should always be careful before
using kernel source as an example of how to write non-kernel
source.
I agree with that, but I think that's more an artifact of
expecting certain definitions of implementation-defined and
implementation-dependent behavior than it is of being a kernel.
Kernels are more prone to rely on those things than most
programs; but so also are many or most programs that run
on bare hardware, and certainly not all of those are kernels.
On the earlier question of whether Linux (or any typical modern
operating system) is part of a C implementations --
Paragraph 1 of section 5 says
An implementation translates C source files and executes C
programs in two data-processing-system environments, which
will be called the /translation environment/ and the
/execution environment/ in this International Standard.
Paragraph 2 of section 1 says
This International Standard does not specify
[...other items...]
. all minimal requirements of a data-processing system that
is capable of supporting a conforming implementation.
My argument is that a running Linux kernel supplies an execution
environment (and perhaps also a translation environment), which
under the descriptions in sections 1 and 5 is a data-processing
system, and as such these /support/ conforming implementations but
are not themselves /part of/ conforming implementations. The
Standard draws a distinct boundary between the two; and conventional
operating systems are clearly on the non-implementation side of that
boundary.