Anton Shepelev <
anto...@gmail.com> writes:
> Following on an on-going discussion, I want to ask
> everybody: is there a compiler that can be set up to accept
> only standard C, that is the language as defined in one of
> the several ISO standards for "The programming language C"?
> I believe such a compiler would be extremely useful for
> everyone who cares about portability or take interest in
> pure C.
The language defined by the ISO C standard explicitly permits extensions
that do not alter the behavior of any strictly conforming program.
I think what you're asking about is a conforming ISO C implementation
that provides no extensions. It could be useful for detecting code that
relies on such extensions. Options to enable and disable optional
features, such as VLAs and complex types, could also be useful.
Another issue is implementation-defined features. For example, this:
unsigned long n = 42;
size_t *ptr = &n;
is not portable, but it's perfectly valid under a conforming
implementation that defines size_t as unsigned long. A compiler that
nevertheless warns about this kind of construct could be useful.
Now that I've expanded on your question, my answer is still that I don't
know whether such a compiler exists.
--
Keith Thompson (The_Other_Keith)
ks...@mib.org <
http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"