ebertolazzi / Splines

Various Splines Interpolation classes
Other
140 stars 23 forks source link

Assert Warning Messages #5

Closed colmartofus closed 5 years ago

colmartofus commented 7 years ago

When I compile just the spline files, I get warning messages about how an unsigned integer will always pass the assertion of being >= 0. Output from gcc++ 4.8 with --std=c++11 flag:

In file included from ../spline_cubic_base.cpp:20:0:
../splines.hpp: In member function ‘const valueType* Splines::SplineSet::yNodes(Splines::sizeType) const’:
../splines.hpp:1477:24: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
       SPLINE_ASSERT( i >=0 && i < _nspl,
                        ^
../splines.hpp:103:12: note: in definition of macro ‘SPLINE_ASSERT’
     if ( !(COND) ) {                        \
            ^
  CXX(target) Release/obj.target/detector/splines.o
In file included from ../splines.cpp:35:0:
../splines.hpp: In member function ‘const valueType* Splines::SplineSet::yNodes(Splines::sizeType) const’:
../splines.hpp:1477:24: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
       SPLINE_ASSERT( i >=0 && i < _nspl,
                        ^
../splines.hpp:103:12: note: in definition of macro ‘SPLINE_ASSERT’
     if ( !(COND) ) {                        \
            ^
  CXX(target) Release/obj.target/detector/spline_akima.o
In file included from ../spline_akima.cpp:20:0:
../splines.hpp: In member function ‘const valueType* Splines::SplineSet::yNodes(Splines::sizeType) const’:
../splines.hpp:1477:24: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
       SPLINE_ASSERT( i >=0 && i < _nspl,
                        ^
../splines.hpp:103:12: note: in definition of macro ‘SPLINE_ASSERT’
     if ( !(COND) ) {                        \
            ^

Note that I renamed the files but these messages occurred before the renaming.

RoyiAvital commented 5 years ago

Hello,

Is there anything comparable which is implemented in C (C99 / ANSI C)?

ebertolazzi commented 5 years ago

Its an OO library, no C version