K
Keith Thompson
jameskuyper said:Does a compiler that generates such code satisfy the "restrictions
placed upon you by that platform"? If so, there's no problem. If not,
then the platform's restrictions are sufficient reason to reject that
compiler; there's no need to mention them in the C standard, so as to
find a second reason for rejecting it.
It depends on just what the platform's restrictions are.
A platform (depending on just what "platform" means) might specify
certain behavior for an attempt to dereference a null pointer, but
I'd expect such restrictions to be stated in terms of executing
certain machine code. If a given chunk of C code is compiled to
machine code that *doesn't* actually dereference a null pointer,
then any platform-level statements would be inapplicable.
Or are you suggesting that the platform would impose restrictions on
the optimizations that can be performed by a C (or other language)
compiler? If so, I think that specifying those restrictions in a
precise and meaningful way could be extraordinarily difficult.