Closed gubatron closed 5 years ago
When you build using the following options:
-Weverything -Wno-c++98-compat -Wno-padded -Wno-global-constructors -Wno-exit-time-destructors -Wno-weak-vtables
several warnings surface out:
Angels-MacBook-Pro:underscore_cpp gubatron$ make [ 12%] Building CXX object CMakeFiles/underscore_static.dir/underscore.cpp.o /Users/gubatron/workspace.frostwire/underscore_cpp/underscore.cpp:170:10: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] return count; ~~~~~~ ^~~~~ 1 warning generated. [ 25%] Linking CXX static library libunderscore_static.a /Library/Developer/CommandLineTools/usr/bin/ranlib: file: libunderscore_static.a(underscore.cpp.o) has no symbols /Library/Developer/CommandLineTools/usr/bin/ranlib: file: libunderscore_static.a(underscore.cpp.o) has no symbols warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: libunderscore_static.a the table of contents is empty (no object file members in the library define global symbols) [ 25%] Built target underscore_static [ 37%] Building CXX object CMakeFiles/underscore_static_tests.dir/testing.cpp.o In file included from /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:2: /Users/gubatron/workspace.frostwire/underscore_cpp/./underscore.cpp:170:10: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] return count; ~~~~~~ ^~~~~ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:4:6: warning: no previous prototype for function 'display' [-Wmissing-prototypes] void display(int x) ^ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:9:5: warning: no previous prototype for function 'incr' [-Wmissing-prototypes] int incr(int x) ^ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:15:5: warning: no previous prototype for function 'mulp' [-Wmissing-prototypes] int mulp(int x) ^ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:20:6: warning: no previous prototype for function 'is_odd' [-Wmissing-prototypes] bool is_odd(int x) ^ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:25:5: warning: no previous prototype for function 'multiply' [-Wmissing-prototypes] int multiply(int x, int y) ^ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:83:30: warning: implicit conversion changes signedness: 'int' to 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-conversion] std::cout << (it->second)[j] << " "; ~ ^ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:94:30: warning: implicit conversion changes signedness: 'int' to 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-conversion] std::cout << (it->second)[j] << " "; ~ ^ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:82:20: warning: comparison of integers of different signs: 'int' and 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-compare] for(int j = 0; j < (it->second).size(); j++) ~ ^ ~~~~~~~~~~~~~~~~~~~ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:93:20: warning: comparison of integers of different signs: 'int' and 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-compare] for(int j = 0; j < (it->second).size(); j++) ~ ^ ~~~~~~~~~~~~~~~~~~~ 10 warnings generated. [ 50%] Linking CXX executable underscore_static_tests [ 50%] Built target underscore_static_tests [ 62%] Building CXX object CMakeFiles/underscore_shared.dir/underscore.cpp.o /Users/gubatron/workspace.frostwire/underscore_cpp/underscore.cpp:170:10: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] return count; ~~~~~~ ^~~~~ 1 warning generated. [ 75%] Linking CXX shared library libunderscore_shared.dylib [ 75%] Built target underscore_shared [ 87%] Building CXX object CMakeFiles/underscore_shared_tests.dir/testing.cpp.o In file included from /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:2: /Users/gubatron/workspace.frostwire/underscore_cpp/./underscore.cpp:170:10: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] return count; ~~~~~~ ^~~~~ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:4:6: warning: no previous prototype for function 'display' [-Wmissing-prototypes] void display(int x) ^ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:9:5: warning: no previous prototype for function 'incr' [-Wmissing-prototypes] int incr(int x) ^ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:15:5: warning: no previous prototype for function 'mulp' [-Wmissing-prototypes] int mulp(int x) ^ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:20:6: warning: no previous prototype for function 'is_odd' [-Wmissing-prototypes] bool is_odd(int x) ^ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:25:5: warning: no previous prototype for function 'multiply' [-Wmissing-prototypes] int multiply(int x, int y) ^ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:83:30: warning: implicit conversion changes signedness: 'int' to 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-conversion] std::cout << (it->second)[j] << " "; ~ ^ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:94:30: warning: implicit conversion changes signedness: 'int' to 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-conversion] std::cout << (it->second)[j] << " "; ~ ^ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:82:20: warning: comparison of integers of different signs: 'int' and 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-compare] for(int j = 0; j < (it->second).size(); j++) ~ ^ ~~~~~~~~~~~~~~~~~~~ /Users/gubatron/workspace.frostwire/underscore_cpp/testing.cpp:93:20: warning: comparison of integers of different signs: 'int' and 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-compare] for(int j = 0; j < (it->second).size(); j++) ~ ^ ~~~~~~~~~~~~~~~~~~~ 10 warnings generated.
When you build using the following options:
several warnings surface out: