[patch] [libcxx] cmakelists.txt - change default warnings

G M gmisocpp at gmail.com
Thu Oct 10 07:26:17 PDT 2013


Hi

Attached is a patch to change the warnings for libcxx.

For gcc/clang I've turned the warning about failing to return a value from
a non void function into a hard error. I hadn't realised it didn't already
do that for g++ when -Wall is on as the cmake file already does.
As a warning it's too easy to miss for returns.

For MSVC I've disabled the warnings about using functions that are
"deprecated" by ms for security reasons.
These are a distraction right now but these warnings could be re-enabled
later once other more pressing problems are resolved.

I've also revised the patch to revert the decision to disable implicit
conversion of  int to bool as Reid pointed out that this wouldn't solve
these warnings in system headers for MSVC as it as no system header pragma
so the only real way to fix these "problems" is to actually go change the
code.

I've already submitted patches that remove some of these errors. I'll
continue to submit more.

This is changing code like bool b = v & m; to b = (v&m) != 0;

Howard please advise if you object to this as I'd like to go ahead and make
these changes. I want to get the MSVC error and warning count to near zero
and it almost is for /W3 which is the default right now..

Please ignore the prior patch I posted relating to cmakelists.txt where I
added the /wd4800 option as it's not viable.

BTW, Howard I think buildit might want the -Werror=return-type option too.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131011/bd22a646/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmakelists.txt.diff
Type: application/octet-stream
Size: 833 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131011/bd22a646/attachment.obj>


More information about the cfe-commits mailing list