[Lldb-commits] [PATCH] Begin cleanup to silence G++ warnings
Matt Johnson
johnso87 at crhc.illinois.edu
Fri Jul 15 13:31:18 PDT 2011
Note,
The line numbering in this patch depends on the previous patch I sent
to the list regarding updating LLDB's usage of Clang/LLVM APIs. See
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20110711/003313.html.
Sorry about that.
-Matt
On 07/15/2011 03: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
>
>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20110715/2e4575e6/attachment.html>
More information about the lldb-commits
mailing list