Is -Werror=pedantic necessary?

Christopher James Halse Rogers raof at ubuntu.com
Thu Nov 14 23:14:19 UTC 2013


Hey all,

Just a quick one, but one that might generate lots of discussion: should
we be building with -Werror=pedantic? What does this buy us?

It *costs* us things like C99 designated-initialisers, which are nice.

As far as I can tell from the gcc manpage, -pedantic doesn't produce
errors for code where it's likely that the behaviour intended by the
programmer doesn't match the actual behaviour (ie: it doesn't seem like
it will help catch coding errors). -pedantic *explicitly* doesn't
provide a guarantee that code that builds with -pedantic set will build
on another ISO C++-compliant compiler, and we already get most of that
benefit by building with clang anyway.

This message brought to you by my latest build failing again because of
the use of C99 designated-initialisers where they're obviously
appropriate.

(If it turns out that we do get value from -Werror=pedantic; great! I
can refer back to the message next time I get annoyed at not being able
to use sensible features ☺).

Chris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/mir-devel/attachments/20131115/afc22c83/attachment.pgp>


More information about the Mir-devel mailing list