4 ms·
The standard version is a TU-wide flag which doesn't help with headers. And it seems like the proposal here is to change the standard so that those legacy const
by dataflow 3y ago
The standard version is a TU-wide flag which doesn't help with headers. And it seems like the proposal here is to change the standard so that those legacy constructs are outright rejected. So my question was, if you're going to change the default in the standard, why not provide a per-header escape hatch for old code?
- kazinator 3y agoI'm not sure which meaning/nuance of standard you are referring to, but the ISO C standard doesn't specify any flags mechanism, translation-unit-wide or otherwise. The GCC implementation (and likely Clang also) supports altering diagnostics over sections of a translation unit. https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html