[lldb-dev] lldb build warnings

Michael Sartain mikesart at valvesoftware.com
Wed Jun 12 12:12:07 PDT 2013


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20130612/1fea5872/attachment.html>


More information about the lldb-dev mailing list