[cfe-dev] RFC: switch default C language mode from gnu99 to gnu11

Robinson, Paul Paul_Robinson at playstation.sony.com
Thu Oct 16 17:17:39 PDT 2014


On Thu, Oct 16, 2014 at 12:58 PM, Richard Smith <richard at metafoo.co.uk<mailto:richard at metafoo.co.uk>> wrote:

I have an additional suggestion: we treat tests that do not explicitly specify a language standard as testing *all* language modes. By default, we continue to run them only in the default language mode of the clang driver, but we:
 -- Add a driver and cc1 flag to set a default language mode for each language
 -- Add a buildbot that runs all tests with the default language mode set to each possible value

This will prevent us from losing most of our C99 test coverage when we switch our default (and would also prevent us from losing most of our C++98 test coverage if/when we switch our default C++ language mode to C++11). The added driver flag might also be useful to people who aren't ready for our new default yet.

For the new flag, how about -std-default=c99 ?

Seems like sufficient lit.cfg magic could vary the substitution of the %clang[_cc1] variables to supply -std=whatever.  As long as Clang's -std option parsing takes the last-one-specified without complaint, any test that explicitly specified -std would still obey that option.  No clang changes needed. One bot per non-default-dialect would be sufficient.

There would be some period of pain while smoking out the tests that actually did depend on the older dialect.  As a data point, when Sony privately switched to default to C++11, we added –std to something like 100-150 tests to get them to pass again, but the rest were all fine.
--paulr

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141017/bacf8334/attachment.html>


More information about the cfe-dev mailing list