James Kuyper said:
I think that the definition of strictly-conforming code is being
generally disregarded by real-world programmers. I suspect that they're
using some other concept of conformance that is more useful by reason of
being more lenient. I also suspect that they're suffering from the fact
that this looser concept is poorly-defined and not officially
standardardized.
The C standard provides two classes of program conformance, strictly
conforming programs that can run under any conforming implementation,
and conforming programs that run under a given conforming implmentation.
When C programmers want to write portable programs, and they don't
always do, then in practice they want to write a sufficiently portable
program that will run under all the implementations they're willing
to spend the effort to get it running under. This means they want it
to be portable more than just one C implmentation, but seldom do they
want it to be portable to every conforming C implementation that exists,
or could possibly ever exist.
So they have to come with a "portability standard" that comes somewhere
between strictly-conforming code and conforming code. But this standard
is going to vary from group to group, depending on what kind portabilty
they need, and so it's essentially impossible for Standard C to define
something that's going to be useful to many programmers.
All this is as I think it should be. I think a strictly conforming
programs should be defined as one that's portable to every conforming C
implementation that could ever be made. I think the C standard should
allow conforming implementations to be reasonably and effeciently
implemented on every kind of platform that C has can be reasonably and
effeciently implemented on, based historical concepts of the scope of C.
As a result, I don't think the definition of a strictly conforming
program is supposed to be something that many programmers could use as
a portiblity standard in actual practice.
To make the concept of a strictly conforming program useful in practice
to a significant number of people in the real world, you have to
greatly limit the number of systems that Standard C could reasonbly
be implemented on. And it still wouldn't useful to a lot of people,
consider that in the GNU coding standards the minimum portiblity required
is "to run on top of the GNU kernel, compiled with the GNU C compiler,
on various types of CPU."
The only thing wrong here is that the defintition of strictly conforming
is more restrictive than what is actually portable to every conforming
implementation that actually exists and we can reasonably assume to exist.
Some of that's partly because it's hard or impossible to come up a
precise enough set of requirements for various things in the standard,
including the actual definition of a strictly conforming program. But I
think there may be room for things like allowing strictly conforming
programmes to use the characters "$" and "@" in strings.
But since it's not of much practical value, I'm not bothered by the fact
that there are some problems with the definition.
Ross Ridge