Mark McIntyre said:
Rhetorical (or disingenuous) question, therefore not answered.
It was neither rhetorical nor disingenuous.
There are degrees of portability. If I refer to something as
"portable", without qualification, I probably mean what you refer to
as "maximally portable". I don't know what distinction you're trying
to make.
Code written in conforming C90 and avoiding any conflicting C99
features (e.g., that avoids using "restrict" or "inline" as
identifiers) is what I'd call "maximally portable", or very close to
it.
[...]
I assume you're a mind-reader.
Richard addressed this elsethread.
Run that by me again: in C90 mode this compiler doesn't conform to
C99?
Um, yes. Do you have a problem with that statement?
[...]
You'd have had one if there were actually any sense to these remarks.
Sorry, but you're being silly - you suggest the compiler be invoked in
C90 mode, and then say that it doesn't conform to C99. Come now.
If Richard wants to write conforming C90 code, he can specify a
certain set of options to gcc; gcc will then issue diagnostics for any
code that doesn't conform to C90. (Or close enough; there's always
the possibility of bugs, but gcc seems to be reasonably solid in this
area.) The resulting code, if gcc accepts it, is very likely to be
portable to any other conforming C90 implementation.
If he wants to write conforming C99 code using the full language, he
can't do it, since gcc doesn't support the full C99 language. He can
write code in the subset of C99 that gcc supports, but such code won't
be portable, since other compilers may support different subsets of
C99; if his code depends on a certain C99 feature that gcc happens to
support, it might break on another compiler that doesn't happen to
support that particular feature (even if it supports a number of other
C99 features).
You say that virtually all C compilers support "//" comments. That
may be true, but gcc doesn't provide a set of options to accept code
written a dialect consisting of just C90 plus "//" comments. You can
tell gcc to accept "//" comments, but only by telling to accept either
the GNU C dialect or the C99 subset that gcc supports. Either option
disables some conformance checks that are necessary if you're going to
write maximally portable code.