[Lldb-commits] [PATCH] Begin cleanup to silence G++ warnings

Johnny Chen johnny.chen at apple.com
Sat Jul 16 11:55:04 PDT 2011


Hi Matt,

Thanks for the patch for silencing G++ warnings.  I'll be looking into and applying the patch.
For the Python docstrings / SWIG warnings by G++, we have been using clang and have
not observed the warnings at all.  However, I think I am going to create, for example, a separate
SWIG interface file SBTarget.i, to spare the SBTarget.h header file from the Python-specific
docstring litter.

And .i interface files for other SB API objects will follow.

Thanks.

Johnny Chen

On Jul 15, 2011, at 1:26 PM, Matt Johnson wrote:

> Hi all,
> This is the beginning of a cleanup effort to reduce the (vast) number of (mostly benign) warnings when compiling LLDB HEAD under G++ 4.5.2 on Ubuntu 11.04. Getting these warnings out of the way makes it much easier to spot more important warnings, if nothing else. The fixes here can be categorized as follows:
> 
> * Use of a signed type as a for loop induction variable, when the loop bound is an unsigned type
> * Assigning NULL (a pointer constant) to non-pointer types (e.g., uint32_t, addr_t)
> * Declaring class members in one order, and including them in constructor initializer lists in a different order
> 
> There are many more of the above warnings that I haven't gotten to yet, as well as things like the following:
> * Python docstrings in e.g. SBTarget.h use a nonstandard gcc preprocessor extension that allows multi-line string literals.
> - This causes *tons* of warnings (one per line of the literal, per inclusion of the relevant header). e.g.:
> 
> /media/d2/llvm/tools/lldb/source/Target/../../include/lldb/API/SBTarget.h:23:1: warning: missing terminating " character
> /media/d2/llvm/tools/lldb/source/Target/../../include/lldb/API/SBTarget.h:48:1: warning: missing terminating " character
> /media/d2/llvm/tools/lldb/source/Target/../../include/lldb/API/SBTarget.h:91:27: warning: missing terminating " character
> /media/d2/llvm/tools/lldb/source/Target/../../include/lldb/API/SBTarget.h:164:5: warning: missing terminating " character
> /media/d2/llvm/tools/lldb/source/Target/../../include/lldb/API/SBTarget.h:180:27: warning: missing terminating " character
> /media/d2/llvm/tools/lldb/source/Target/../../include/lldb/API/SBTarget.h:216:5: warning: missing terminating " character
> /media/d2/llvm/tools/lldb/source/Target/../../include/lldb/API/SBTarget.h:224:27: warning: missing terminating " character
> /media/d2/llvm/tools/lldb/source/Target/../../include/lldb/API/SBTarget.h:245:5: warning: missing terminating " character
> /media/d2/llvm/tools/lldb/source/Target/../../include/lldb/API/SBTarget.h:253:27: warning: missing terminating " character
> /media/d2/llvm/tools/lldb/source/Target/../../include/lldb/API/SBTarget.h:277:5: warning: missing terminating " character
> /media/d2/llvm/tools/lldb/source/Target/../../include/lldb/API/SBTarget.h:286:27: warning: missing terminating " character
> /media/d2/llvm/tools/lldb/source/Target/../../include/lldb/API/SBTarget.h:310:5: warning: missing terminating " character
> /media/d2/llvm/tools/lldb/source/Target/../../include/lldb/API/SBTarget.h:334:27: warning: missing terminating " character
> /media/d2/llvm/tools/lldb/source/Target/../../include/lldb/API/SBTarget.h:361:5: warning: missing terminating " character
> /media/d2/llvm/tools/lldb/source/Target/../../include/lldb/API/SBTarget.h:370:27: warning: missing terminating " character
> /media/d2/llvm/tools/lldb/source/Target/../../include/lldb/API/SBTarget.h:386:5: warning: missing terminating " character
> 
> - These literals should be formed like:
> 
> #ifdef SWIG
> %feature("docstring",
> "Represents the target program running under the debugger.\n"
> "\n"
> "SBTarget supports module and breakpoint iterations. For example,\n"
> ...
> 
> - instead of:
> 
> %feature("docstring",
> "Represents the target program running under the debugger.
> 
> SBTarget supports module and breakpoint iterations. For example,
> ...
> 
> 
> * Use of (deprecated) <ext/hash_map> instead of <unordered_map>
> * Not handling some enum values in a switch statement. e.g., "ClangASTType.cpp:283:12: warning: enumeration value ‘UnaryTransform’ not handled in switch"
> * Defining static helper functions that are never used. e.g., "RegisterContextLinux_x86_64.cpp:408:17: warning: ‘unsigned int GetRegSize(unsigned int)’ defined but not used"
> 
> Comments welcome.
> Best,
> Matt
> <cleanup.diff>_______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits





More information about the lldb-commits mailing list