Is -Werror=pedantic necessary?

Daniel van Vugt daniel.van.vugt at
Fri Nov 15 04:44:24 UTC 2013

Unfortunately C99 is not a subset of C++11. They're very different 
things. So to assume your compiler needs to support both simultaneously 
is a danger to portability.

Portability to other platforms is nice-to-have for Mir. But also within 
Linux, static analysis tools (and compilers) will typically only handle 
strong enforcement of one language spec at a time.

I would prefer we kept strong enforcement of a standard, any standard, 
rather than relaxing the rules and making Mir less portable.

"Strong" doesn't guarantee compliance, like you say. But it's better 
than weak.

On 15/11/13 12:17, Christopher James Halse Rogers wrote:
> On Fri, 2013-11-15 at 09:39 +0800, Daniel van Vugt wrote:
>> I would prefer to keep pedantic mode. Issues like using C99
>> designated-initializers in C++ are actually compliance issues you should
>> be told about. It's nice to know when you're no longer using the
>> language standard you told the compiler you would use.
> This is what I'm asking - is it really? Especially given that using
> -pedantic does *not* guarantee you're using the language standard you
> told the compiler you would use anyway.
> The standard is useful to not tie you into a single compiler, but it's
> not like any sensible compiler is going to support C++11 but *not* C99,
> and our clang builds already guarantee that we're not tied into a single
> compiler.
>> If you need to include other peoples' code which use non-compliant
>> language features then why not just:
> It's not that I want to use other peoples' non-compliant code. It's that
> *I* want to write non-compliant code. Or, rather, I want to write code
> that I know all non-stupid compilers are going to interpret correctly,
> but isn't strictly in the C++11 spec.

More information about the Mir-devel mailing list