[cmake-developers] cmake --deprecated-warnings and cmake --deprecated-errors

Matthew Woehlke matthew.woehlke at kitware.com
Tue Jul 30 12:16:47 EDT 2013


On 2013-07-30 08:45, Brad King wrote:
> On 07/30/2013 06:30 AM, Stephen Kelly wrote:
>> I wonder if we should add --deprecated-warnings and --deprecated-errors and
>> document them in cmake --help, as --warn-uninitialized etc? I think it's
>> something we can do after 2.8.12, but I want to make sure it doesn't change
>> anything in how the deprecation stuff works or is used currently.
>
> The first warning option ever added was -Wdev and the intention at the
> time was to use -W... for all warning options.  That was forgotten by
> the time --warn-uninitialized was created.  Perhaps that can be cleaned
> up now:
>
>   -Wdeprecated
>   -Wdeprecated=error
>   -Wuninitialized

If you haven't already, please consider -W[no-][error=]<name> (instead 
of -W<name>[=error]) for consistency with GCC... e.g.:

-Wdeprecated
-Wno-deprecated
-Werror=deprecated
-Wno-error=deprecated

Note:
-W<name> => <name>_level = std::min(<name>_level, WARN)
-Wno<name> => <name>_level = IGNORED
-Werror=<name> => <name>_level = ERROR
-Wno-error=<name> => <name>_level = std::max(<name>_level, WARN)
(where IGNORED < WARN < ERROR)

-- 
Matthew




More information about the cmake-developers mailing list