Keith Thompson said:
Tim Rentsch said:
Keith Thompson said:
[...]
I understand your thesis here, but you still haven't presented
any convincing evidence that it's correct. Any device for which
a conforming C compiler cannot be fairly easily provided is so
limited (or perhaps unorthodox) that a suitable language for
it would not be C-like except perhaps very superficially.
I think this may be the fundamental point on which we disagree.
I haven't worked on very small embedded systems, but I can imagine a
system (again, an 8051 or 4004 might qualify) where it makes
perfectly good sense to implement all C syntax and semantics
*except* that, say, floating-point types and integers wider than 16
bits are not supported.
This can be done in a conforming implementation, as I have
already explained.
[...]
An implementation that has no support for floating-point, for a
target system on which such support would not be useful, can be
"conforming" only in some sense that is practically
indistinguishable from non-conformance.
I'm not sure why you put quotes around the word conforming, since
I am using the word in the same sense that the Standard defines
it. More importantly the phrasing used disguises the distinction
I am trying to highlight: the key question is not whether an
implmentation is conforming -- which might be true purely by
accident -- but whether its implementtors are committed to
delivering a conforming implementation. Continued below...
There are over 100 articles in this thread, but I think this is
what you're referring to:
) Yes but it doesn't have to. The bar for a freestanding
) implementation is very low, because there is no lower bound on
) the maximum object size that must be supported. A freestanding
) implementation could simply not accept any program that uses
) any type larger than 16 bits, with a diagnostic indicating an
) environmental limit has been exceeded. Support for underranged
) types, or unusual floating-point environments, could be enabled
) by using #pragma or defining a symbol like __BOGUS. The result
) satisfies both criteria - it can support very small systems,
) and would also be a conforming implementation.
You later said that any error message needn't specifically refer
to an environmental limit. But the real limit on the hypothetical
system has nothing to do with size; it might support 32-bit
integers, but not 32-bit floating-point, for example, and will
almost certainly support 32-bit and larger arrays and structures.
Sure, you could have a different limit for floating-point types
vs. other types, but I don't think that's the right approach.
The only relevant question on this point is whether the Standard
allows such behavior in a conforming implementation. Do you
agree that it does? If not, why not? Obviously how diagnostics
are worded is important in terms of user reaction, but has no
bearing on conformance -- the message might be "sorry, charlie,
take your floating point somewhere else", and that wouldn't
change anything (ie, as regards the conformance question).
I *think* you're suggesting justifying the lack of support for
floating-point by citing (directly or indirectly) an environmental
limit rather than by acknowledging that floating-point (which is
not an optional feature) is not supported.
I'm not making any statement about any particular implementation,
either justifying or (non-)acknowledging. My intention is to
explain and support the thesis that a freestanding implementation
may refuse to accept programs that use floating-point operations
and yet still be conforming.
What is the difference between a "conforming" implementation that
rejects all use floating-point due to an environmental limit and a
"non-conforming" implementation that does so because it just
doesn't support floating-point?
The way the question is asked it's impossible to answer, but
let's consider a related scenario.
Suppose we have two groups of implementors, A and B. Group A has
decided to do a conforming implementation. Group B has decided
to implement "C-", which is most of C but leaves out some things
that they feel would impact the implementation too much, such as
floating point and 'long long'. The implementation of group A is
conforming working under the assumption of the thesis posited
above. The implementation of group B might or might not be
conforming under the same conditions.
Given this state of affairs, what do we know? About the
implementation done by group A, we know two things:
1. The implementation will issue a diagnostic for any
program that contains a constraint violation, and
2. Any program that is accepted without a diagnostic will
behave as specified by the relevant ISO standard.
About the implementation done by group B, we know essentially
nothing. Probably it will behave like ISO C in most cases, but
there's no way to be sure without a careful reading of the
documentation done for implementation B, and even then we might
not know. Furthermore, when the next release arrives things
might be different, because group B has decided on their own what
language to implement. Granted, group B's language(s) will be a
lot like standard C, but just how much is up to them - having
abandoned the principle of conformance in one area, we may
reasonably expect they may be lax about conformance in another
area.
The single statement that an implementation is conforming (and
that its implementors are committed to having it be conforming)
conveys by itself a tremendous amount of information, even
under the assumption that it may, eg, refuse to accept programs
that use floating point (or 'long long', etc). It is for this
reason that there is a big difference between "conforming" and
"non-conforming" implementations, as I understand what you take
the quoted terms to mean.