* Old Wolf:
Alf said:
Old said:
You're confusing two different
meanings of the word "error". The meanings are:
1. Ill-formed code
2. A diagnostic that indicates the compiler found ill-formed code.
The OP was asking about error[2].
Natural language doesn't work like mathematical substitution.
The base meaning of "error" as as ill-formed code is the same
in [1] and [2].
No, it isn't. [1] is referring to code, and [2] is referring to an
indication. These are separate entities.
The base meaning is the same: ill-formed code. That's why you found it
necessary to include the phrase "ill-formed code" in both points. In
point [2] you're /using/ that meaning to talk about a diagnostic.
[snip]
Right, what I should have said was: it does not make any
distinction between error indications, and other indications;
Well, Jerry Coffin wrote, in response to "What's not [in the standard]
is how a compiler should distinguish output messages that refer to
ill-formed code, i.e. standards violations for pure C++", that
"The standard requires that it be documented."
Let's call this Requirement X.
I happen to not share Jerry's viewpoint, so as you can see there is no
universal agreement on this. You're on one end of the scale,
maintaining there is no requirement X; I'm in the middle somewhere,
maintaining there is an implicit requirement X; and Jerry is at the
other end, maintaining that there is an explicit requirement X.
and in particular there is no discussion of differences between
an "error message" and a "warning message".
That's generally not within the standard's domain.
So it's generally quite irrelevant.
There is however one exceptional case where I think it would be
appropriate if the standard made a distinction about what kind of
diagnostic should be issued, at a sufficient high level of abstraction
(i.e. not dictating the form of message class identification), namely
where you have a language extension. Alas, the standard only
distinguishes this diagnostic by noting that after issuing it, an
implementation can go on to translate (heh, here the standard actually
uses the word "compile", I didn't notice that!) and execute the program.
One implication is that in other error cases the implementation can't
or shouldn't execute the program, but that's nowhere stated outright; it
just makes the clarification meaningless if that was not the intent.
Whether a compiler labels a message as "error" or "warning"
is up to that compiler, and it does not render the implementation
non-conforming if a required diagnostic is labelled "warning".
That's right, but, so what?
There are several cases where that can happen. One is that the compiler
does not employ the "warning" versus "error" distinction, but some other
way of identifying standard violations. Another is that the compiler
implements a language extension, in which case a "warning" is IMO most
appropriate, since the code is not in error with respect to the extended
language (the standard still requires that use of the language extension
be diagnosed, and a quality compiler will offer a standards mode where
use of such extensions are diagnosed as plain errors). A third is that
the compiler is simply non-conforming, in that it doesn't identify
standard rule violations as such, in which case it cannot be rendered
non-conforming: it already is (assuming there is a requirement X).