[Bug 19418] New: lots of warnings when building lldb

Bug ID 19418
Summary lots of warnings when building lldb
Product lldb
Version unspecified
Hardware PC
OS Linux
Status NEW
Severity normal
Priority P
Component All Bugs
Assignee lldb-dev@cs.uiuc.edu
Reporter tfarina@chromium.org
CC tfiala@google.com
Classification Unclassified

../tools/lldb/source/API/SBCommunication.cpp: In member function 'bool
lldb::SBCommunication::SetReadThreadBytesReceivedCallback(lldb::SBCommunication::ReadThreadBytesReceived,
void*)':
../tools/lldb/source/API/SBCommunication.cpp:253:54: warning: ISO C++ forbids
casting between pointer-to-function and pointer-to-object [enabled by default]
                      reinterpret_cast<void*>(callback),
                                                      ^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-deprecated-register"
[enabled by default]
[325/829] Building CXX object
tools/lldb/source/API/CMakeFiles/lldbAPI.dir/SBBreakpoint.cpp.o
In file included from /usr/include/python2.7/Python.h:8:0,
                 from ../tools/lldb/include/lldb/lldb-python.h:21,
                 from
../tools/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h:20,
                 from
../tools/lldb/include/lldb/DataFormatters/TypeSummary.h:27,
                 from
../tools/lldb/include/lldb/DataFormatters/FormattersContainer.h:30,
                 from
../tools/lldb/include/lldb/DataFormatters/FormatManager.h:23,
                 from ../tools/lldb/include/lldb/Core/Debugger.h:27,
                 from ../tools/lldb/source/API/SBBreakpoint.cpp:22:
/usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined
[enabled by default]
 #define _POSIX_C_SOURCE 200112L
 ^
In file included from
/usr/local/gcc/gcc-4.8.2/include/c++/4.8.2/x86_64-unknown-linux-gnu/bits/os_defines.h:39:0,
                 from
/usr/local/gcc/gcc-4.8.2/include/c++/4.8.2/x86_64-unknown-linux-gnu/bits/c++config.h:426,
                 from /usr/local/gcc/gcc-4.8.2/include/c++/4.8.2/utility:68,
                 from /usr/local/gcc/gcc-4.8.2/include/c++/4.8.2/algorithm:60,
                 from ../tools/lldb/include/lldb/Utility/SharingPtr.h:13,
                 from ../tools/lldb/include/lldb/lldb-forward.h:15,
                 from ../tools/lldb/include/lldb/lldb-types.h:14,
                 from ../tools/lldb/include/lldb/lldb-defines.h:13,
                 from ../tools/lldb/include/lldb/API/SBDefines.h:18,
                 from ../tools/lldb/include/lldb/API/SBBreakpoint.h:13,
                 from ../tools/lldb/source/API/SBBreakpoint.cpp:10:
/usr/include/features.h:164:0: note: this is the location of the previous
definition
 # define _POSIX_C_SOURCE 200809L
 ^
In file included from /usr/include/python2.7/Python.h:8:0,
                 from ../tools/lldb/include/lldb/lldb-python.h:21,
                 from
../tools/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h:20,
                 from
../tools/lldb/include/lldb/DataFormatters/TypeSummary.h:27,
                 from
../tools/lldb/include/lldb/DataFormatters/FormattersContainer.h:30,
                 from
../tools/lldb/include/lldb/DataFormatters/FormatManager.h:23,
                 from ../tools/lldb/include/lldb/Core/Debugger.h:27,
                 from ../tools/lldb/source/API/SBBreakpoint.cpp:22:
/usr/include/python2.7/pyconfig.h:1183:0: warning: "_XOPEN_SOURCE" redefined
[enabled by default]
 #define _XOPEN_SOURCE 600
 ^
In file included from
/usr/local/gcc/gcc-4.8.2/include/c++/4.8.2/x86_64-unknown-linux-gnu/bits/os_defines.h:39:0,
                 from
/usr/local/gcc/gcc-4.8.2/include/c++/4.8.2/x86_64-unknown-linux-gnu/bits/c++config.h:426,
                 from /usr/local/gcc/gcc-4.8.2/include/c++/4.8.2/utility:68,
                 from /usr/local/gcc/gcc-4.8.2/include/c++/4.8.2/algorithm:60,
                 from ../tools/lldb/include/lldb/Utility/SharingPtr.h:13,
                 from ../tools/lldb/include/lldb/lldb-forward.h:15,
                 from ../tools/lldb/include/lldb/lldb-types.h:14,
                 from ../tools/lldb/include/lldb/lldb-defines.h:13,
                 from ../tools/lldb/include/lldb/API/SBDefines.h:18,
                 from ../tools/lldb/include/lldb/API/SBBreakpoint.h:13,
                 from ../tools/lldb/source/API/SBBreakpoint.cpp:10:
/usr/include/features.h:166:0: note: this is the location of the previous
definition
 # define _XOPEN_SOURCE 700
 ^
cc1plus: warning: unrecognized command line option "-Wno-deprecated-register"
[enabled by default]
[328/829] Building CXX object
tools/lldb/source/API/CMakeFiles/lldbAPI.dir/SBHostOS.cpp.o
../tools/lldb/source/API/SBHostOS.cpp: In static member function 'static
lldb::thread_t lldb::SBHostOS::ThreadCreate(const char*, lldb::thread_func_t,
void*, lldb::SBError*)':
../tools/lldb/source/API/SBHostOS.cpp:54:67: warning: ISO C++ forbids casting
between pointer-to-function and pointer-to-object [enabled by default]
                      name, reinterpret_cast<void*>(thread_function),
                                                                   ^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-deprecated-register"
[enabled by default]
[330/829] Building CXX object
tools/lldb/source/API/CMakeFiles/lldbAPI.dir/SBBreakpointLocation.cpp.o
In file included from /usr/include/python2.7/Python.h:8:0,
                 from ../tools/lldb/include/lldb/lldb-python.h:21,
                 from
../tools/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h:20,
                 from
../tools/lldb/include/lldb/DataFormatters/TypeSummary.h:27,
                 from
../tools/lldb/include/lldb/DataFormatters/FormattersContainer.h:30,
                 from
../tools/lldb/include/lldb/DataFormatters/FormatManager.h:23,
                 from ../tools/lldb/include/lldb/Core/Debugger.h:27,
                 from ../tools/lldb/source/API/SBBreakpointLocation.cpp:20:
/usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined
[enabled by default]
 #define _POSIX_C_SOURCE 200112L
 ^
In file included from
/usr/local/gcc/gcc-4.8.2/include/c++/4.8.2/x86_64-unknown-linux-gnu/bits/os_defines.h:39:0,
                 from
/usr/local/gcc/gcc-4.8.2/include/c++/4.8.2/x86_64-unknown-linux-gnu/bits/c++config.h:426,
                 from /usr/local/gcc/gcc-4.8.2/include/c++/4.8.2/utility:68,
                 from /usr/local/gcc/gcc-4.8.2/include/c++/4.8.2/algorithm:60,
                 from ../tools/lldb/include/lldb/Utility/SharingPtr.h:13,
                 from ../tools/lldb/include/lldb/lldb-forward.h:15,
                 from ../tools/lldb/include/lldb/lldb-types.h:14,
                 from ../tools/lldb/include/lldb/lldb-defines.h:13,
                 from ../tools/lldb/include/lldb/API/SBDefines.h:18,
                 from ../tools/lldb/include/lldb/API/SBBreakpointLocation.h:13,
/usr/include/features.h:164:0: note: this is the location of the previous
definition
 # define _POSIX_C_SOURCE 200809L
 ^
In file included from /usr/include/python2.7/Python.h:8:0,
                 from ../tools/lldb/include/lldb/lldb-python.h:21,
                 from
../tools/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h:20,
                 from
../tools/lldb/include/lldb/DataFormatters/TypeSummary.h:27,
                 from
../tools/lldb/include/lldb/DataFormatters/FormattersContainer.h:30,
                 from
../tools/lldb/include/lldb/DataFormatters/FormatManager.h:23,
                 from ../tools/lldb/include/lldb/Core/Debugger.h:27,
                 from ../tools/lldb/source/API/SBBreakpointLocation.cpp:20:
/usr/include/python2.7/pyconfig.h:1183:0: warning: "_XOPEN_SOURCE" redefined
[enabled by default]
 #define _XOPEN_SOURCE 600
 ^
In file included from
/usr/local/gcc/gcc-4.8.2/include/c++/4.8.2/x86_64-unknown-linux-gnu/bits/os_defines.h:39:0,
                 from
/usr/local/gcc/gcc-4.8.2/include/c++/4.8.2/x86_64-unknown-linux-gnu/bits/c++config.h:426,
                 from /usr/local/gcc/gcc-4.8.2/include/c++/4.8.2/utility:68,
                 from /usr/local/gcc/gcc-4.8.2/include/c++/4.8.2/algorithm:60,
                 from ../tools/lldb/include/lldb/Utility/SharingPtr.h:13,
                 from ../tools/lldb/include/lldb/lldb-forward.h:15,
                 from ../tools/lldb/include/lldb/lldb-types.h:14,
                 from ../tools/lldb/include/lldb/lldb-defines.h:13,
                 from ../tools/lldb/include/lldb/API/SBDefines.h:18,
                 from ../tools/lldb/include/lldb/API/SBBreakpointLocation.h:13,
                 from ../tools/lldb/source/API/SBBreakpointLocation.cpp:10:
/usr/include/features.h:166:0: note: this is the location of the previous
definition
 # define _XOPEN_SOURCE 700
 ^
cc1plus: warning: unrecognized command line option "-Wno-deprecated-register"
[enabled by default]
[353/829] Building CXX object
tools/lldb/source/API/CMakeFiles/lldbAPI.dir/SBTarget.cpp.o
../tools/lldb/source/API/SBTarget.cpp: In member function 'lldb::SBError
lldb::SBTarget::SetSectionLoadAddress(lldb::SBSection, lldb::addr_t)':
../tools/lldb/source/API/SBTarget.cpp:2427:30: warning: variable 'stop_id' set
but not used [-Wunused-but-set-variable]
                     uint32_t stop_id = 0;
                              ^
../tools/lldb/source/API/SBTarget.cpp: In member function 'lldb::SBError
lldb::SBTarget::ClearSectionLoadAddress(lldb::SBSection)':
../tools/lldb/source/API/SBTarget.cpp:2463:22: warning: variable 'stop_id' set
but not used [-Wunused-but-set-variable]
             uint32_t stop_id = 0;
                      ^
../tools/lldb/source/API/SBTarget.cpp: In member function 'lldb::SBError
lldb::SBTarget::ClearModuleLoadAddress(lldb::SBModule)':
../tools/lldb/source/API/SBTarget.cpp:2542:30: warning: variable 'stop_id' set
but not used [-Wunused-but-set-variable]
                     uint32_t stop_id = 0;
                              ^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-deprecated-register"
[enabled by default]
[465/829] Building CXX object
tools/lldb/source/Core/CMakeFiles/lldbCore.dir/PluginManager.cpp.o
../tools/lldb/source/Core/PluginManager.cpp: In function
'lldb_private::FileSpec::EnumerateDirectoryResult LoadPluginCallback(void*,
lldb_private::FileSpec::FileType, const lldb_private::FileSpec&)':
../tools/lldb/source/Core/PluginManager.cpp:118:159: warning: ISO C++ forbids
casting between pointer-to-function and pointer-to-object [enabled by default]
                 plugin_info.plugin_init_callback =
(PluginInitCallback)Host::DynamicLibraryGetSymbol (plugin_info.plugin_handle,
"LLDBPluginInitialize", error);
                                                                               
                                                                              
^
../tools/lldb/source/Core/PluginManager.cpp:128:162: warning: ISO C++ forbids
casting between pointer-to-function and pointer-to-object [enabled by default]
                     plugin_info.plugin_term_callback =
(PluginTermCallback)Host::DynamicLibraryGetSymbol (plugin_info.plugin_handle,
"LLDBPluginTerminate", error);
                                                                               
                                                                               
  ^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-deprecated-register"
[enabled by default]

Vince Harron changed bug 19418

What | Removed | Added |

Comment # 1 on bug 19418 from Vince Harron

We're mostly using clang these days.

It would be nice to fix these though, because we do need to build with gcc in
certain circumstances.

cc1plus: warning: unrecognized command line option "-Wno-deprecated-register" 

It looks like this one only pops up if there are other warnings in the file. 
Strange.

$ cat ~/dev/main.cpp
int main() { return 0; }
$ /usr/bin/g++ -Wno-deprecated-declarations ~/dev/main.cpp
$ 

$ cd /usr/local/google/home/vharron/ll/tot/eclipse/gcc/tools/lldb/tools/driver
&& /usr/bin/g++   -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -DLIBXML2_DEFINED -D_DEBUG
-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS -fuse-ld=gold -fPIC -fvisibility-inlines-hidden -Wall -W
-Wno-unused-parameter -Wwrite-strings -Wcast-qual
-Wno-missing-field-initializers -pedantic -Wno-long-long
-Wno-maybe-uninitialized -Wno-comment -std=c++11 -Wno-deprecated-declarations
-Wno-unknown-pragmas -Wno-deprecated-register  -fno-exceptions -fno-rtti -g
-I/usr/local/google/home/vharron/ll/tot/eclipse/gcc/tools/lldb/tools/driver
-I/usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/driver
-I/usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/include
-I/usr/local/google/home/vharron/ll/tot/eclipse/gcc/tools/lldb/include
-I/usr/local/google/home/vharron/ll/tot/eclipse/gcc/include
-I/usr/local/google/home/vharron/ll/tot/llvm/include -I/usr/include/python2.7
-I/usr/include/x86_64-linux-gnu/python2.7
-I/usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/../clang/include
-I/usr/local/google/home/vharron/ll/tot/eclipse/gcc/tools/lldb/../clang/include
-I/usr/include/libxml2    -fno-exceptions -fno-rtti -o
CMakeFiles/lldb.dir/Driver.cpp.o -c
/usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/driver/Driver.cpp
/usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/driver/Driver.cpp:
In function ‘FILE* PrepareCommandsForSourcing(const char*, size_t, int*)’:
/usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/driver/Driver.cpp:870:10:
warning: variable ‘success’ set but not used [-Wunused-but-set-variable]
     bool success = true;
          ^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-deprecated-register"
[enabled by default]
$ 

(fix the warning and it goes away)