[cmake-developers] Clang 3.5-svn emmits tautological-pointer-compare warning

Christoph Grüninger foss at grueninger.de
Fri Jun 20 04:02:43 EDT 2014


Hi CMake developers,
I like CMake for not generating a ton of warnings. I just tried with a
recent SVN version of Clang 3.5 which learned again new warnings:

> [  6%] Building CXX object Source/kwsys/CMakeFiles/cmsys.dir/SystemInformation.cxx.o                                                                                              
> /opt/cmake-git/cmake/Source/kwsys/SystemInformation.cxx:3786:17: warning: comparison of array 'unameInfo.release' not equal to a null pointer is always true
>       [-Wtautological-pointer-compare]
>   if( unameInfo.release!=0 && strlen(unameInfo.release)>=3 )
>       ~~~~~~~~~~^~~~~~~  ~
> 1 warning generated.

Find attached a patch the removes the condition that is always true.
Maybe you want to keep the condition as an assert?

Bye
Christoph
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Remove-condition-which-is-always-true.patch
Type: text/x-patch
Size: 930 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140620/7943305c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140620/7943305c/attachment.sig>


More information about the cmake-developers mailing list