sempr-tk / sempr

SEMPR - Semantic Environment Mapping, Processing and Reasoning
BSD 3-Clause "New" or "Revised" License
7 stars 1 forks source link

fix a bunch of warnings #46

Closed niniemann closed 6 years ago

niniemann commented 6 years ago

While using sempr in another project, I noticed that clang shows me quite a lot of warnings, which g++ should show me, too, but curiously doesn't (despite the -Wall flag).

A lot of them were missing override keywords in the new coordinate system code. So I just compiled sempr with clang++ and added the missing keywords. :)

But some warnings remain, which I did not address yet -- maybe you want to fix them, @ctieben?

sempr/src/entity/spatial/reference/MilitaryGridReferenceSystem.cpp:183:25: warning: comparison of unsigned expression < 0 is always     false [-Wtautological-compare]
       if (squareID.size() < 0 || squareID.size() > 2)
           ~~~~~~~~~~~~~~~ ^ ~
   1 warning generated.
   sempr/src/entity/spatial/reference/GlobalCS.cpp:27:19: warning: expression with side effects will be evaluated despite being used a    s an operand to 'typeid' [-Wpotentially-evaluated-expression]
       return typeid(*other) == typeid(*this);
                     ^
   1 warning generated.
  sempr/test/spatial_index_tests.cpp:37:42: warning: suggest braces around initialization of subobject [-Wmissing-braces]
           mp->setGeometry(setupQuadrangle({1, 1, 1}, {10, 10, 10}));
                                            ^~~~~~~
                                            {      }
  sempr/test/spatial_index_tests.cpp:37:53: warning: suggest braces around initialization of subobject [-Wmissing-braces]
          mp->setGeometry(setupQuadrangle({1, 1, 1}, {10, 10, 10}));
                                                      ^~~~~~~~~~

(Though I must admit that the missing braces are probably my fault.)

ctieben commented 6 years ago

The first and second warning are fixed in 09cbb7d1408f26ee535000b744e48e41b9863b4c