OutpostUniverse / OP2Utility

C++ library for working with Outpost 2 related files and tasks.
MIT License
4 stars 0 forks source link

Fix cumulated warnings in Clang/gcc #314

Closed Brett208 closed 4 years ago

Brett208 commented 4 years ago

g++ -Isrc -I/usr/src/googletest/googletest/include/ -MT .build/testObj/BitTwiddle.test.o -MMD -MP -MF .build/testObj/BitTwiddle.test.Td -std=c++17 -g -Wall -Wno-unknown-pragmas -c -o .build/testObj/BitTwiddle.test.o -Isrc test/BitTwiddle.test.cpp In file included from test/BitTwiddle.test.cpp:2:0: /usr/src/googletest/googletest/include/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperEQ(const char, const char, const T1&, const T2&) [with T1 = int; T2 = unsigned int]': /usr/src/googletest/googletest/include/gtest/gtest.h:1459:23: required from 'static testing::AssertionResult testing::internal::EqHelper::Compare(const char, const char, const T1&, const T2&, typename testing::internal::EnableIf<(! testing::internal::is_pointer::value)>::type*) [with T1 = int; T2 = unsigned int; typename testing::internal::EnableIf<(! testing::internal::is_pointer::value)>::type = void]' test/BitTwiddle.test.cpp:27:2: required from here /usr/src/googletest/googletest/include/gtest/gtest.h:1392:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (lhs == rhs) {


g++ -Isrc -I/usr/src/googletest/googletest/include/ -MT .build/testObj/Rect.test.o -MMD -MP -MF .build/testObj/Rect.test.Td -std=c++17 -g -Wall -Wno-unknown-pragmas  -c -o .build/testObj/Rect.test.o -Isrc test/Rect.test.cpp
g++ -Isrc -I/usr/src/googletest/googletest/include/ -MT .build/testObj/ResourceManager.test.o -MMD -MP -MF .build/testObj/ResourceManager.test.Td -std=c++17 -g -Wall -Wno-unknown-pragmas  -c -o .build/testObj/ResourceManager.test.o -Isrc test/ResourceManager.test.cpp
In file included from test/ResourceManager.test.cpp:2:0:
/usr/src/googletest/googletest/include/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = long unsigned int]':
/usr/src/googletest/googletest/include/gtest/gtest.h:1459:23:   required from 'static testing::AssertionResult testing::internal::EqHelper<true>::Compare(const char*, const char*, const T1&, const T2&, typename testing::internal::EnableIf<(! testing::internal::is_pointer<T2>::value)>::type*) [with T1 = int; T2 = long unsigned int; typename testing::internal::EnableIf<(! testing::internal::is_pointer<T2>::value)>::type = void]'
test/ResourceManager.test.cpp:31:2:   required from here
/usr/src/googletest/googletest/include/gtest/gtest.h:1392:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (lhs == rhs) {
       ~~~~^~~~~~

g++ -Isrc -I/usr/src/googletest/googletest/include/ -MT .build/testObj/Map/Map.test.o -MMD -MP -MF .build/testObj/Map/Map.test.Td -std=c++17 -g -Wall -Wno-unknown-pragmas  -c -o .build/testObj/Map/Map.test.o -Isrc test/Map/Map.test.cpp
In file included from src/Map/Map.h:3:0,
                 from test/Map/Map.test.cpp:1:
src/Map/Tile.h:11:22: warning: 'Tile::cellType' is too small to hold all values of 'enum class CellType'
  CellType cellType : 5;
                      ^

g++ -Isrc -I/usr/src/googletest/googletest/include/ -MT .build/testObj/Map/MapReader.test.o -MMD -MP -MF .build/testObj/Map/MapReader.test.Td -std=c++17 -g -Wall -Wno-unknown-pragmas  -c -o .build/testObj/Map/MapReader.test.o -Isrc test/Map/MapReader.test.cpp
In file included from src/Map/Map.h:3:0,
                 from test/Map/MapReader.test.cpp:1:
src/Map/Tile.h:11:22: warning: 'Tile::cellType' is too small to hold all values of 'enum class CellType'
  CellType cellType : 5;
                      ^

g++ -Isrc -I/usr/src/googletest/googletest/include/ -MT .build/testObj/Map/MapHeader.test.o -MMD -MP -MF .build/testObj/Map/MapHeader.test.Td -std=c++17 -g -Wall -Wno-unknown-pragmas  -c -o .build/testObj/Map/MapHeader.test.o -Isrc test/Map/MapHeader.test.cpp
In file included from test/Map/MapHeader.test.cpp:2:0:
/usr/src/googletest/googletest/include/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = unsigned int]':
/usr/src/googletest/googletest/include/gtest/gtest.h:1421:23:   required from 'static testing::AssertionResult testing::internal::EqHelper<lhs_is_null_literal>::Compare(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = unsigned int; bool lhs_is_null_literal = false]'
test/Map/MapHeader.test.cpp:27:2:   required from here
/usr/src/googletest/googletest/include/gtest/gtest.h:1392:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (lhs == rhs) {
       ~~~~^~~~~~

g++ -Isrc -I/usr/src/googletest/googletest/include/ -MT .build/testObj/Map/MapWriter.test.o -MMD -MP -MF .build/testObj/Map/MapWriter.test.Td -std=c++17 -g -Wall -Wno-unknown-pragmas  -c -o .build/testObj/Map/MapWriter.test.o -Isrc test/Map/MapWriter.test.cpp
In file included from src/Map/Map.h:3:0,
                 from test/Map/MapWriter.test.cpp:1:
src/Map/Tile.h:11:22: warning: 'Tile::cellType' is too small to hold all values of 'enum class CellType'
  CellType cellType : 5;
                      ^

g++ -Isrc -I/usr/src/googletest/googletest/include/ -MT .build/testObj/Bitmap/ImageHeader.test.o -MMD -MP -MF .build/testObj/Bitmap/ImageHeader.test.Td -std=c++17 -g -Wall -Wno-unknown-pragmas  -c -o .build/testObj/Bitmap/ImageHeader.test.o -Isrc test/Bitmap/ImageHeader.test.cpp
In file included from test/Bitmap/ImageHeader.test.cpp:2:0:
/usr/src/googletest/googletest/include/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = long unsigned int]':
/usr/src/googletest/googletest/include/gtest/gtest.h:1421:23:   required from 'static testing::AssertionResult testing::internal::EqHelper<lhs_is_null_literal>::Compare(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = long unsigned int; bool lhs_is_null_literal = false]'
test/Bitmap/ImageHeader.test.cpp:80:2:   required from here
/usr/src/googletest/googletest/include/gtest/gtest.h:1392:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (lhs == rhs) {
       ~~~~^~~~~~

g++ -Isrc -I/usr/src/googletest/googletest/include/ -MT .build/testObj/Tag.test.o -MMD -MP -MF .build/testObj/Tag.test.Td -std=c++17 -g -Wall -Wno-unknown-pragmas  -c -o .build/testObj/Tag.test.o -Isrc test/Tag.test.cpp
In file included from test/Tag.test.cpp:2:0:
/usr/src/googletest/googletest/include/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = long unsigned int]':
/usr/src/googletest/googletest/include/gtest/gtest.h:1421:23:   required from 'static testing::AssertionResult testing::internal::EqHelper<lhs_is_null_literal>::Compare(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = long unsigned int; bool lhs_is_null_literal = false]'
test/Tag.test.cpp:9:2:   required from here
/usr/src/googletest/googletest/include/gtest/gtest.h:1392:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (lhs == rhs) {
       ~~~~^~~~~~

g++ -Isrc -I/usr/src/googletest/googletest/include/ -MT .build/testObj/Archive/ArchiveFile.test.o -MMD -MP -MF .build/testObj/Archive/ArchiveFile.test.Td -std=c++17 -g -Wall -Wno-unknown-pragmas  -c -o .build/testObj/Archive/ArchiveFile.test.o -Isrc test/Archive/ArchiveFile.test.cpp
In file included from test/Archive/ArchiveFile.test.cpp:1:0:
src/Archive/VolFile.h:70:25: warning: 'Archive::VolFile::SectionHeader::padding' is too small to hold all values of 'enum class Archive::VolFile::VolPadding'
    VolPadding padding : 1;
                         ^

In file included from test/Archive/ArchiveFile.test.cpp:4:0:
/usr/src/googletest/googletest/include/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperGT(const char*, const char*, const T1&, const T2&) [with T1 = long unsigned int; T2 = int]':
test/Archive/ArchiveFile.test.cpp:66:2:   required from here
/usr/src/googletest/googletest/include/gtest/gtest.h:1530:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/src/googletest/googletest/include/gtest/gtest.h:1510:7:
   if (val1 op val2) {\

/usr/src/googletest/googletest/include/gtest/gtest.h:1530:28: GTEST_IMPL_CMPHELPER(GT, >); /usr/src/googletest/googletest/include/gtest/gtest.h:1510:12: note: in definition of macro 'GTEST_IMPL_CMPHELPER' if (val1 op val2) {\ ^~ /usr/src/googletest/googletest/include/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperEQ(const char, const char, const T1&, const T2&) [with T1 = int; T2 = long unsigned int]': /usr/src/googletest/googletest/include/gtest/gtest.h:1459:23: required from 'static testing::AssertionResult testing::internal::EqHelper::Compare(const char, const char, const T1&, const T2&, typename testing::internal::EnableIf<(! testing::internal::is_pointer::value)>::type*) [with T1 = int; T2 = long unsigned int; typename testing::internal::EnableIf<(! testing::internal::is_pointer::value)>::type = void]' test/Archive/ArchiveFile.test.cpp:65:2: required from here /usr/src/googletest/googletest/include/gtest/gtest.h:1392:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (lhs == rhs) {



g++ -Isrc -I/usr/src/googletest/googletest/include/ -MT .build/testObj/Stream/DynamicMemoryWriter.test.o -MMD -MP -MF .build/testObj/Stream/DynamicMemoryWriter.test.Td -std=c++17 -g -Wall -Wno-unknown-pragmas  -c -o .build/testObj/Stream/DynamicMemoryWriter.test.o -Isrc test/Stream/DynamicMemoryWriter.test.cpp
In file included from test/Stream/DynamicMemoryWriter.test.cpp:2:0:
/usr/src/googletest/googletest/include/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = long unsigned int]':
/usr/src/googletest/googletest/include/gtest/gtest.h:1459:23:   required from 'static testing::AssertionResult testing::internal::EqHelper<true>::Compare(const char*, const char*, const T1&, const T2&, typename testing::internal::EnableIf<(! testing::internal::is_pointer<T2>::value)>::type*) [with T1 = int; T2 = long unsigned int; typename testing::internal::EnableIf<(! testing::internal::is_pointer<T2>::value)>::type = void]'
test/Stream/DynamicMemoryWriter.test.cpp:12:2:   required from here
/usr/src/googletest/googletest/include/gtest/gtest.h:1392:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (lhs == rhs) {
       ~~~~^~~~~~

g++ -Isrc -I/usr/src/googletest/googletest/include/ -MT .build/testObj/Stream/FileReader.test.o -MMD -MP -MF .build/testObj/Stream/FileReader.test.Td -std=c++17 -g -Wall -Wno-unknown-pragmas  -c -o .build/testObj/Stream/FileReader.test.o -Isrc test/Stream/FileReader.test.cpp
In file included from test/Stream/BidirectionalReader.test.h:4:0,
                 from test/Stream/FileReader.test.cpp:1:
/usr/src/googletest/googletest/include/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = long unsigned int]':
/usr/src/googletest/googletest/include/gtest/gtest.h:1459:23:   required from 'static testing::AssertionResult testing::internal::EqHelper<true>::Compare(const char*, const char*, const T1&, const T2&, typename testing::internal::EnableIf<(! testing::internal::is_pointer<T2>::value)>::type*) [with T1 = int; T2 = long unsigned int; typename testing::internal::EnableIf<(! testing::internal::is_pointer<T2>::value)>::type = void]'
test/Stream/FileReader.test.cpp:21:2:   required from here
/usr/src/googletest/googletest/include/gtest/gtest.h:1392:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (lhs == rhs) {
       ~~~~^~~~~~

test/Stream/SliceReader.test.cpp:89:1:   required from here
/usr/src/googletest/googletest/include/gtest/gtest.h:1392:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (lhs == rhs) {
       ~~~~^~~~~~

g++ -Isrc -I/usr/src/googletest/googletest/include/ -MT .build/testObj/Stream/MemoryStreamReader.test.o -MMD -MP -MF .build/testObj/Stream/MemoryStreamReader.test.Td -std=c++17 -g -Wall -Wno-unknown-pragmas  -c -o .build/testObj/Stream/MemoryStreamReader.test.o -Isrc test/Stream/MemoryStreamReader.test.cpp
In file included from test/Stream/Reader.test.h:4:0,
                 from test/Stream/MemoryStreamReader.test.cpp:1:
/usr/src/googletest/googletest/include/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = long unsigned int]':
/usr/src/googletest/googletest/include/gtest/gtest.h:1459:23:   required from 'static testing::AssertionResult testing::internal::EqHelper<true>::Compare(const char*, const char*, const T1&, const T2&, typename testing::internal::EnableIf<(! testing::internal::is_pointer<T2>::value)>::type*) [with T1 = int; T2 = long unsigned int; typename testing::internal::EnableIf<(! testing::internal::is_pointer<T2>::value)>::type = void]'
test/Stream/MemoryStreamReader.test.cpp:33:2:   required from here
/usr/src/googletest/googletest/include/gtest/gtest.h:1392:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (lhs == rhs) {
       ~~~~^~~~~~
DanRStevens commented 4 years ago

Tagging issues #176 and #175 as related.

DanRStevens commented 4 years ago

The new warnings here seem to be related to the signed/unsigned comparisons in the unit test code.

The enum size warnings are a deeper problem, which are tracked in issue #176.

Should be quick to fix the signed/unsigned warnings.