Subject: Re: [boost] Bug report rejected as conformant
From: Marc Glisse (marc.glisse_at_[hidden])
Date: 2018-01-13 21:08:23
On Sat, 13 Jan 2018, Edward Diener via Boost wrote:
> On 1/13/2018 1:55 PM, Marc Glisse via Boost wrote:
>> On Sat, 13 Jan 2018, Edward Diener via Boost wrote:
>>> I recently reported a preprocessor bug in Oracle C++ 12.6 on their online
>>> forum when compiling a C program example. I even cited the C11 standard in
>>> showing that Oracle C++ 12.6's actions were non-conformant. The answer I
>>> was given, from an Oracle C++ developer who said he was a member of the
>>> C++ standard committee, is that since Oracle C++ 12.6 gives a warning
>>> message rather than a compiler error the compiler was compliant with the C
>>> standard, since the standard only requires a diagnostic message to be
>>> considered standard compliant when it does not implement the compiler
>>> according to the standard, and that a warning was a diagnostic message.
>>> Furthermore since there was a way to force the particular warning to be
>>> considered an error, Oracle was not going to change their compiler. At
>>> that point I "lost it" so to speak.
>>> I cannot conceive that any C/C++ standard would specify that giving a
>>> warning rather than an error, when not complying with the C/C++ standard,
>>> would then make the compiler compliant. Comments ?
>> Uh, that's what all compilers do all the time when they implement
>> extensions to the standard. With gcc, you even need to specify -Wpedantic
>> to get those required diagnostics. I am really surprised that this is the
>> first compiler for which you notice this...
> So a compiler is allowed to implement an extension to the standard which is
> non-compliant with the standard,
"non-compliant" is your judgement.
> and then claim compliance to the standard by
> outputting a warning message instead ?
That's always been all the standards require. Picking a random sentence
from the C++ standard: "if [...], a conforming implementation shall issue
at least one diagnostic message". Seems pretty clear to me that warnings
satisfy this requirement. And from discussions in the C++ committee, it is
definitely interpreted that way.
> In that case what hope is there for the programmer to write C/C++
> standard compliant code using such a compiler,
Note that this is not a priority for compiler vendors. Accepting legacy
programs comes before rejecting invalid ones.
If the compiler is giving you a warning, read it? How is prefixing the
message with "error:" clearer than with "warning:"?
> since the compiler is "inventing" a standard which does not exist ?
> Note that the error I reported was not when using any
> -std=some_compilers_extension mode ( as in gcc's -std=gnu++nn mode as opposed
> to -std=c++nn mode) but with -std=c11 mode, which is explained as being an
> implementation of the c11 standard. In other words if I were using an Oracle
> c11 mode, as in a hypothetical -std=oracle++c11, I would not have complained
> about their extension to the standard or their cavalier treatment of a bug as
> not being a bug because they produced a warning. But that was not the case
> and the mode being used was the -std=c11 mode, which evidently means to
> Oracle C++ whatever they feel like defining as the c11 standard even if it
> does not follow the actual c11 standard.
Again, this is in no way specific to Oracle's compiler.
I am still trying to figure out why you are getting so angry about it. If
the extension was breaking some subtle sfinae detection code, I could
understand, but the preprocessor cannot be involved there. Does it break
some feature detection in a configuration script? That's one case where
indeed warnings can be much less helpful than errors, but I would still be
surprised if that is the case you are in.
(maybe I should read your bug report before posting anything else...)
-- Marc Glisse
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk