[cmake-developers] CMake API for warnings

Simon Richter Simon.Richter at hogyros.de
Wed Mar 30 17:31:44 EDT 2016


Hi,

On 27.03.2016 07:10, Geoffrey Viola wrote:

> CMake should support an API to manage compiler warnings to simplify a
> common problem. Using more compilers with high levels of warnings means
> cheap static analysis and better conformance to standard C++.

With my Linux distro hat on: please don't force warning levels from
inside projects.

Packages are often automatically compiled on different platforms, and we
do want to know about third party modules generating warnings on the
more obscure ones where sizeof(long) < sizeof(void *), because no human
will ever have more than a casual look at the build logs unless there
are warnings there that do not appear on other platforms.

With my program maintainer hat on:

What I'd really like to see is cross-platform selection of warning
types. In flex generated code, there are lots of "unused named argument"
warnings from both gcc and cl.exe, which I'd like to turn off exactly
for those generated files, without introducing compiler-specific code,
or overriding the global default from the cmake invocation.

With my continuous integration hat on:

While we're on the topic of warnings: when cmake is re-run because
CMakeLists.txt changed, it would be great to get a list of source/object
files and/or program invocations that vanished. I have a compiler
wrapper that stores the warnings into a database, and fetches warnings
for objects that weren't rebuilt so they are included into the reports,
but this doesn't track source files that were dropped.

   Simon

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160330/4d38d461/attachment.sig>


More information about the cmake-developers mailing list