libglui / glui

GLUI is a GLUT-based C++ user interface library which provides controls such as buttons, checkboxes, radio buttons, and spinners to OpenGL applications. It is window-system independent, using GLUT or FreeGLUT.
Other
194 stars 82 forks source link

Remaining gcc warnings #115

Closed nigels-com closed 5 years ago

nigels-com commented 5 years ago

The Linux build of GLUI is using -std=c++11 -O0 -Wall -pedantic

Some compilation warnings for gcc 7.4.0 remain

In file included from src/glui_internal_control.h:29:0,
                 from src/glui_textbox.cpp:34:
src/glui_textbox.cpp: In member function ‘virtual int GLUI_TextBox::special_handler(int, int)’:
src/glui_internal.h:104:66: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define CLAMP(x,lo,hi)  {if ((x) < (lo)) {(x)=(lo);} else if((x) > (hi)) {(x)=(hi);}}
                                                              ~~~~^~~~~~
src/glui_textbox.cpp:964:3: note: in expansion of macro ‘CLAMP’
   CLAMP( insertion_pt, 0, text.length()); /* Make sure insertion_pt
   ^~~~~
src/glui_internal.h:104:66: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define CLAMP(x,lo,hi)  {if ((x) < (lo)) {(x)=(lo);} else if((x) > (hi)) {(x)=(hi);}}
                                                              ~~~~^~~~~~
src/glui_textbox.cpp:966:3: note: in expansion of macro ‘CLAMP’
   CLAMP( sel_start, 0, text.length()); /* Make sure insertion_pt
   ^~~~~
src/glui_internal.h:104:66: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define CLAMP(x,lo,hi)  {if ((x) < (lo)) {(x)=(lo);} else if((x) > (hi)) {(x)=(hi);}}
                                                              ~~~~^~~~~~
src/glui_textbox.cpp:968:3: note: in expansion of macro ‘CLAMP’
   CLAMP( sel_end, 0, text.length()); /* Make sure insertion_pt
   ^~~~~
g++ -std=c++11 -O0 -Wall -pedantic -I/usr/X11R6/include -I./src -I./include -c src/quaternion.cpp -o src/quaternion.o
src/quaternion.cpp: In function ‘quat operator*(const quat&, const quat&)’:
src/quaternion.cpp:117:55: warning: suggest parentheses around arithmetic in operand of ‘^’ [-Wparentheses]
     return quat( a.s*b.s - a.v*b.v, a.s*b.v + b.s*a.v + a.v^b.v );