[gcc message pointing to wrong 'prototype' for declaration conflict]
I guess my question is, where do conformance issues end and QoI issues
begin? You say, "the original code *required* at least one diagnostic
and got it". True, but what if the diagnostic had been:
test.c:666: error: elephants are trampling your begonias
QoI takes over pretty early. Dan (probably deliberately) restated in
passing the Standard's requirement, from (C99) 5.1.1.3p1:
A conforming implementation shall produce at least one diagnostic
message (identified in
an implementation-defined manner) if a preprocessing translation unit
or translation unit
contains a violation of any syntax rule or constraint, even if the
behavior is also explicitly
specified as undefined or implementation-defined. Diagnostic messages
need not be
produced in other circumstances.8)
same in C89 except for the "even if" clause, which actually seems to
be superfluous; and referring to footnote 8 or 6 respectively, but
footnotes are not normative:
The intent is that an implementation should identify the nature of,
and where possible localize, each
violation. Of course, an implementation is free to produce any number
of diagnostics as long as a
valid program is still correctly translated. It may also successfully
translate an invalid program.
Thus diagnostics are not *required* to identify or describe the error,
or even to be one per detected error; a compiler with the (in)famous
'ed' behavior of simply printing a single question mark '?' for any
error or combination of errors would be conforming, at least in that
respect; and moreover since an implementation may produce any
diagnostics it likes beyond the required one(s), a compiler that
printed a single question mark for every sourcefile, with errors or
without, would also be conforming, but perverse. Even if both beer and
speech free it wouldn't attract or deserve many users.
Your particular example warning is therefore conforming; but for me
useless since I happen not to have any begonias -- so it would
intrigue me what -W flag gcc would use to disable (or enable?) it:
maybe -W[no-]pachyderm-deflorestation ?-)
- David.Thompson1 at worldnet.att.net