[lldb-dev] lldb build warnings

Malea, Daniel daniel.malea at intel.com
Wed Jun 12 13:32:41 PDT 2013


Our intention was to suppress (false positives) by adding the "–Wno" switches to the definition lists in the top–level CMakeLists.txt  (see around line 114) but clearly have not been vigilant enough about suppressing warnings or fixing them as they crop up :(

Personally, I look forward to the day we turn on –Werror (if not –Wall) but that may not be in the near future.

Cheers,
Dan

From: <Thirumurthi>, Ashok Thirumurthi <ashok.thirumurthi at intel.com<mailto:ashok.thirumurthi at intel.com>>
Date: Wednesday, 12 June, 2013 4:09 PM
To: Mike Sartain <mikesart at valvesoftware.com<mailto:mikesart at valvesoftware.com>>, "lldb-dev at cs.uiuc.edu<mailto:lldb-dev at cs.uiuc.edu>" <lldb-dev at cs.uiuc.edu<mailto:lldb-dev at cs.uiuc.edu>>
Subject: Re: [lldb-dev] lldb build warnings


Ø  -Wno-sign-compare -Wno-four-char-constants -Wno-extended-offsetof -Wno-unused-function
Do you need to disable these warnings when building with clang 3.4?  The short list of remaining warnings that you quoted is more consistent with the clang 3.4 buildbot runs.  Example:
  http://lab.llvm.org:8011/builders/lldb-x86_64-debian-clang/builds/4094/steps/compile/logs/warnings%20%286%29

FYI, Matt has done a great job of fixing a lot of warnings to date.  Example:
  http://llvm.org/viewvc/llvm-project?rev=183140&view=rev


-        Ashok

From: lldb-dev-bounces at cs.uiuc.edu<mailto:lldb-dev-bounces at cs.uiuc.edu> [mailto:lldb-dev-bounces at cs.uiuc.edu] On Behalf Of Michael Sartain
Sent: Wednesday, June 12, 2013 3:12 PM
To: lldb-dev at cs.uiuc.edu<mailto:lldb-dev at cs.uiuc.edu>
Subject: [lldb-dev] lldb build warnings

How do folks handle warnings when building debug lldb?

I'm building on Linux with Clang 3.2 and had to add these options to get the number down to a reasonable count:

-Wno-sign-compare -Wno-four-char-constants -Wno-extended-offsetof -Wno-unused-function

Still seeing several others though (down below). Having all these warnings can make it difficult to track down new ones though.
 -Mike

mikesart at mikesart-rad:~/data/src/llvm/build$ lldb_build
ninja: Entering directory `/home/mikesart/data/src/llvm/build'
[88/2270] cd /home/mikesart/data/src/llvm/build/tools/clang/lib/Basic && /usr/local/bin/cmak...ang/lib/Basic/SVNVersion.inc -P /home/mikesart/data/src/llvm/llvm/cmake/modules/GetSVN.cmak
-- Found Subversion: /usr/bin/svn (found version "1.7.9")
[140/2270] Building lldb python wrapper
SWIG needs to be re-run.
[633/2270] Building CXX object lib/Target/PowerPC/InstPrinter/CMakeFiles/LLVMPowerPCAsmPrinter.dir/PPCInstPrinter.cpp.o
/home/mikesart/data/src/llvm/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp:92:13: warning: enumeration value 'PRED_BAD' not handled in switch [-Wswitch]
    switch ((PPC::Predicate)Code) {
            ^
1 warning generated.
[722/2270] Building CXX object lib/Target/PowerPC/MCTargetDesc/CMakeFiles/LLVMPowerPCDesc.dir/PPCPredicates.cpp.o
/home/mikesart/data/src/llvm/llvm/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp:20:11: warning: enumeration value 'PRED_BAD' not handled in switch [-Wswitch]
  switch (Opcode) {
          ^
/home/mikesart/data/src/llvm/llvm/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp:34:11: warning: enumeration value 'PRED_BAD' not handled in switch [-Wswitch]
  switch (Opcode) {
          ^
2 warnings generated.
[1936/2270] Building CXX object tools/lldb/source/Core/CMakeFiles/lldbCore.dir/DataExtractor.cpp.o
/home/mikesart/data/src/llvm/llvm/tools/lldb/source/Core/DataExtractor.cpp:1328:22: warning: hexadecimal floating constants are a C99 feature [-Wc99-extensions]
        return u.f * 0x1.0p125f;
                     ^
/home/mikesart/data/src/llvm/llvm/tools/lldb/source/Core/DataExtractor.cpp:1333:18: warning: hexadecimal floating constants are a C99 feature [-Wc99-extensions]
    return u.f * 0x1.0p-112f;
                 ^
2 warnings generated.
[2264/2270] Building CXX object tools/lldb/source/CMakeFiles/liblldb.dir/__/scripts/LLDBWrapPython.cpp.o
tools/lldb/scripts/LLDBWrapPython.cpp:2380:23: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign]
                  res = SWIG_AddCast(res);
                  ~~~ ^              ~~~
tools/lldb/scripts/LLDBWrapPython.cpp:2383:23: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign]
                  res = SWIG_AddCast(res);
                  ~~~ ^              ~~~
tools/lldb/scripts/LLDBWrapPython.cpp:2905:9: warning: variable 'res' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    if (PyType_Ready(tp) < 0)
        ^~~~~~~~~~~~~~~~~~~~
tools/lldb/scripts/LLDBWrapPython.cpp:2929:10: note: uninitialized use occurs here
  return res;
         ^~~
tools/lldb/scripts/LLDBWrapPython.cpp:2905:5: note: remove the 'if' if its condition is always false
    if (PyType_Ready(tp) < 0)
    ^~~~~~~~~~~~~~~~~~~~~~~~~
tools/lldb/scripts/LLDBWrapPython.cpp:2886:10: note: initialize the variable 'res' to silence this warning
  int res;
         ^
          = 0
tools/lldb/scripts/LLDBWrapPython.cpp:54935:14: warning: explicitly assigning a variable of type 'void *' to itself [-Wself-assign]
  clientdata = clientdata;
  ~~~~~~~~~~ ^ ~~~~~~~~~~
4 warnings generated.





More information about the lldb-dev mailing list