Defect Report #176
Submission Date: 16 Oct 95
Source: Clive D.W. Feather
Submitted to BSI by Clive D.W. Feather firstname.lastname@example.org .
In this Defect Report, identifiers lexically identical to those
declared in standard headers refer to the identifiers declared in those
standard headers, whether or not the header is explicitly mentioned.
This Defect Report has been prepared with considerable help from
Mark Brader, Jutta Degener, Ronald Guilmette, and a person whose
employment conditions require anonymity. However, except where stated,
opinions expressed or implied should not be assumed to be those of any
person other than myself.
Defect Report UK 024: Diagnostics for #error
The rules concerning whether #error generates a
diagnostic are contradictory.
Subclause 22.214.171.124 reads:
A conforming implementation shall produce at least one diagnostic
message (identified in an implementation-defined manner) for every
translation unit that contains a violation of any syntax rule or
constraint. Diagnostic messages need not be produced in other
Subclause 6.8.5 reads:
A preprocessing directive of the form
# error pp-tokens new-line opt
causes the implementation to produce a diagnostic message that
includes the specified sequence of preprocessing tokens.
Since this is not in a Constraints section, these two statements
directly contradict one another. Furthermore, the second statement can
be read as applying to a #error directive that is
excluded by a false
Suggested Technical Corrigendum
In subclause 6.8.5, replace the entire subclause with:
A #error preprocessing directive shall not occur
in a translation unit. Any diagnostic message generated because of the
violation of this constraint [Footnote: The intent of this subclause is
that #error indicates that translation should fail. As
stated in subclause 126.96.36.199, a translation unit excludes lines within
false side of #if ... #else
... #endif groups.] shall include the sequence of
preprocessing tokens in the directive.
Previous Defect Report
< - >
Next Defect Report