Context: C compilers deliberately do not support some features while being conforming implementations. Is it ok?
Some examples. All of the compilers down below are conforming implementations (__STDC__
is defined to 1
). However:
gcc does not support
#pragma STDC FENV_ACCESS
and issueswarning: ignoring ‘#pragma STDC FENV_ACCESS’ [-Wunknown-pragmas]
. However, fenv.h is a standard header, and support of#pragma STDC FENV_ACCESS ON
is required by the standard, becauseON
is one of the choices in on-off-switch:ON OFF DEFAULT
.msvc does not support
#pragma STDC FP_CONTRACT
and rather supports its own version#pragma fp_contract ( { on | off } )
. However, the standard version is#pragma STDC FP_CONTRACT { ON | OFF | DEFAULT }
.gcc on Cygwin: sscanf doesn't handle hexadecimal floating-point input. And libc is a part of the standard.
Question: is it allowed for an implementation to deliberately provide a limited functionality (or its own version of such functionality) and still be conforming implementation at the same time?
Reason of the question: better understanding of the definition of conforming implementation
and the state of affairs around existing conforming implementations.
Note: here the area of interest is conforming hosted implementation only. However, the question is applicable for conforming freestanding implementation as well.
UPD. Again: __STDC__ is defined to 1
means maybe conforming implementation rather than conforming implementation. Any discrepancy with the standard automatically makes such implementation be "nonconforming implementation that defines __STDC__
to 1".