[CMake] Error on uninitialized vars?

David Cole david.cole at kitware.com
Wed May 25 12:12:03 EDT 2011


Johan,

I do not think there's a built-in way to make these warnings into errors...
It would be easy enough to do, but it's not there right now.

One reason is that most projects were developed with the understanding that
${uninitialized_variable} resolves to empty. Many projects even depend on
this, and so making it a warning first (that must be explicitly turned on),
seemed to be the right way to approach it.

I'm curious: what sorts of "nasty bugs" did you find...?


HTH,
David


On Tue, May 24, 2011 at 7:42 AM, Johan Björk <phb at spotify.com> wrote:

> Hi guys,
>
> I just discovered the --warn-uninitialized flag to cmake, and in the
> process found some really nasty bugs. Is there any way to enable this
> from the CMakeLists.txt files? Is there a corresponding
> --error-uninitialized value?
>
> Thanks
> /Johan
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110525/30332fa3/attachment.htm>


More information about the CMake mailing list