[cmake-developers] -isystem suppresses warnings from user header
Tamás Kenéz
tamas.kenez at gmail.com
Thu Apr 7 10:03:12 EDT 2016
Environment: CMake 3.5, linux, g++
CMake uses "-isystem" on the compiler command line for the
INTERFACE_INCLUDE_DIRECTORIES of imported libraries.
Unfortunately including a header via an isystem path suppresses warnings
emitted from the header, such as warnings caused by expansions of macros
defined in that header.
Example: I have a printf-like LOG(...) macro which expands to a function
marked as printf-like. The -Wformat warnings are suppressed if the
containing log.h is found on isystem path.
Question: is this the intended behaviour? Can I force the -I flag somehow
for my library? (I'm aware of CMAKE_INCLUDE_SYSTEM_FLAG_CXX but I don't
want to modify all the client projects that uses my library.)
Or is it bug?
Thanks,
Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160407/4d9081fe/attachment.html>
More information about the cmake-developers
mailing list