Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile with warning as error #74

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

fghoussen
Copy link
Contributor

Compile with warning as error.

Note: gave up on Qt deprecated declarations for a start...

…tion of ‘q’ shadows a member of ‘qglviewer::Quaternion’ [-Werror=shadow]

  170 |   Quaternion &operator*=(const Quaternion &q) {
      |                          ~~~~~~~~~~~~~~~~~~^
/tmp/libQGLViewer/build/QGLViewer_autogen/QGLViewer/quaternion.h:309:9: note: shadowed declaration is here
  309 |   qreal q[4];
      |         ^
…declaration of ‘d’ shadows a member of ‘BSPNode’ [-Werror=shadow]

  542 | void BSPNode::initEquation(const Polygone *P,double & a, double & b, double & c, double & d)
      |                                                                                  ~~~~~~~~~^
/tmp/libQGLViewer/QGLViewer/VRender/BSPSortMethod.cpp:93:30: note: shadowed declaration is here
   93 |                 double a,b,c,d;
      |                              ^
…declaration of ‘c’ shadows a member of ‘BSPNode’ [-Werror=shadow]

  542 | void BSPNode::initEquation(const Polygone *P,double & a, double & b, double & c, double & dd)
      |                                                                      ~~~~~~~~~^
/tmp/libQGLViewer/QGLViewer/VRender/BSPSortMethod.cpp:93:28: note: shadowed declaration is here
   93 |                 double a,b,c,d;
      |                            ^
…declaration of ‘b’ shadows a member of ‘BSPNode’ [-Werror=shadow]

  542 | void BSPNode::initEquation(const Polygone *P,double & a, double & b, double & c, double & dd)
      |                                                          ~~~~~~~~~^
/tmp/libQGLViewer/QGLViewer/VRender/BSPSortMethod.cpp:93:26: note: shadowed declaration is here
   93 |                 double a,b,c,d;
      |                          ^
…declaration of ‘a’ shadows a member of ‘BSPNode’ [-Werror=shadow]

  542 | void BSPNode::initEquation(const Polygone *P,double & a, double & bb, double & cc, double & dd)
      |                                              ~~~~~~~~~^
/tmp/libQGLViewer/QGLViewer/VRender/BSPSortMethod.cpp:93:24: note: shadowed declaration is here
   93 |                 double a,b,c,d;
      |                        ^
… vrender::operator*(const NVector3&, const Vector3&)’ has not been declared within ‘vrender’ [-Werror]

   41 | double vrender::operator*(const NVector3 &u,const Vector3  &v)
      |        ^~~~~~~
In file included from /tmp/libQGLViewer/QGLViewer/VRender/NVector3.cpp:1:
/tmp/libQGLViewer/QGLViewer/VRender/NVector3.h:45:19: note: only here as a ‘friend’
   45 |     friend double operator*(const NVector3 &u,const Vector3  &v);
      |                   ^~~~~~~~
… vrender::operator*(const Vector3&, const NVector3&)’ has not been declared within ‘vrender’ [-Werror]

   46 | double vrender::operator*(const Vector3  &u,const NVector3 &v)
      |        ^~~~~~~
In file included from /tmp/libQGLViewer/QGLViewer/VRender/NVector3.cpp:1:
/tmp/libQGLViewer/QGLViewer/VRender/NVector3.h:46:19: note: only here as a ‘friend’
   46 |     friend double operator*(const Vector3  &u,const NVector3 &v);
      |                   ^~~~~~~~
…::ostream& vrender::operator<<(std::ostream&, const Feedback3DColor&)’ has not been declared within ‘vrender’ [-Werror]

  121 | std::ostream& vrender::operator<<(std::ostream& o,const Feedback3DColor& f)
      |               ^~~~~~~
In file included from /tmp/libQGLViewer/QGLViewer/VRender/Primitive.cpp:3:
/tmp/libQGLViewer/QGLViewer/VRender/Primitive.h:61:38: note: only here as a ‘friend’
   61 |                 friend std::ostream& operator<<(std::ostream&,const Feedback3DColor&) ;
      |                                      ^~~~~~~~
…::Vector2 vrender::operator-(const Vector2&)’ has not been declared within ‘vrender’ [-Werror]

   50 | Vector2 vrender::operator- (const Vector2& u)
      |         ^~~~~~~
In file included from /tmp/libQGLViewer/QGLViewer/VRender/Vector2.cpp:1:
/tmp/libQGLViewer/QGLViewer/VRender/Vector2.h:73:40: note: only here as a ‘friend’
   73 |                         friend Vector2 operator- (const Vector2&);
      |                                        ^~~~~~~~
…::Vector3 vrender::operator*(double, const Vector3&)’ has not been declared within ‘vrender’ [-Werror]

   81 | Vector3 vrender::operator* (double r,const Vector3& u)
      |         ^~~~~~~
In file included from /tmp/libQGLViewer/QGLViewer/VRender/Vector3.cpp:2:
/tmp/libQGLViewer/QGLViewer/VRender/Vector3.h:114:40: note: only here as a ‘friend’
  114 |                         friend Vector3 operator* (double,const Vector3&);
      |                                        ^~~~~~~~
…ostream& vrender::operator<<(std::ostream&, const Vector3&)’ has not been declared within ‘vrender’ [-Werror]

  111 | std::ostream& vrender::operator<< (std::ostream& out,const Vector3& u)
      |               ^~~~~~~
/tmp/libQGLViewer/QGLViewer/VRender/Vector3.h:127:46: note: only here as a ‘friend’
  127 |                         friend std::ostream& operator<< (std::ostream&,const Vector3&);
      |                                              ^~~~~~~~
…‘proj’ shadows a previous local [-Werror=shadow]

 1038 |       qreal proj = fabs(directions[0][i] * dir);
      |             ^~~~
/tmp/libQGLViewer/QGLViewer/frame.cpp:1009:9: note: shadowed declaration is here
 1009 |   qreal proj;
      |         ^~~~
…‘axis’ shadows a previous local [-Werror=shadow]

 1046 |       const Vec axis = cross(directions[0][index[0]], dir);
      |                 ^~~~
/tmp/libQGLViewer/QGLViewer/frame.cpp:1025:15: note: shadowed declaration is here
 1025 |     const Vec axis = cross(directions[0][index[0]], directions[1][index[1]]);
      |               ^~~~
…‘angle’ shadows a previous local [-Werror=shadow]

 1047 |       qreal angle = asin(axis.norm());
      |             ^~~~~
/tmp/libQGLViewer/QGLViewer/frame.cpp:1026:11: note: shadowed declaration is here
 1026 |     qreal angle = asin(axis.norm());
      |           ^~~~~
…eclaration of ‘v1’ shadows a member of ‘qglviewer::KeyFrameInterpolator’ [-Werror=shadow]

  340 |         Vec v1 = 3.0 * diff - 2.0 * kf_[1]->tgP() - kf_[2]->tgP();
      |             ^~
In file included from /tmp/libQGLViewer/QGLViewer/camera.h:5,
                 from /tmp/libQGLViewer/QGLViewer/qglviewer.h:4,
                 from /tmp/libQGLViewer/QGLViewer/keyFrameInterpolator.cpp:2:
/tmp/libQGLViewer/QGLViewer/keyFrameInterpolator.h:354:7: note: shadowed declaration is here
  354 |   Vec v1, v2;
      |       ^~
…eclaration of ‘v2’ shadows a member of ‘qglviewer::KeyFrameInterpolator’ [-Werror=shadow]

  341 |         Vec v2 = -2.0 * diff + kf_[1]->tgP() + kf_[2]->tgP();
      |             ^~
In file included from /tmp/libQGLViewer/QGLViewer/camera.h:5,
                 from /tmp/libQGLViewer/QGLViewer/qglviewer.h:4,
                 from /tmp/libQGLViewer/QGLViewer/keyFrameInterpolator.cpp:2:
/tmp/libQGLViewer/QGLViewer/keyFrameInterpolator.h:354:11: note: shadowed declaration is here
  354 |   Vec v1, v2;
      |           ^~
… of ‘text’ shadows a previous local [-Werror=shadow]

 1897 |     QString text = mouseActionString(itmb.value().action);
      |             ^~~~
/tmp/libQGLViewer/QGLViewer/qglviewer.cpp:1846:11: note: shadowed declaration is here
 1846 |   QString text(
      |           ^~~~
… of ‘text’ shadows a previous local [-Werror=shadow]

 1921 |     QString text = mouseActionString(itw.value().action);
      |             ^~~~
/tmp/libQGLViewer/QGLViewer/qglviewer.cpp:1846:11: note: shadowed declaration is here
 1846 |   QString text(
      |           ^~~~
… of ‘q’ shadows a member of ‘qglviewer::Quaternion’ [-Werror=shadow]

  227 |   Quaternion q(element);
      |              ^
In file included from /tmp/libQGLViewer/QGLViewer/quaternion.cpp:1:
/tmp/libQGLViewer/QGLViewer/quaternion.h:309:9: note: shadowed declaration is here
  309 |   qreal q[4];
      |         ^
@fghoussen
Copy link
Contributor Author

fghoussen commented Jul 25, 2023

#75 (comment): seems there are cross dependencies between NVector3 and Vector3: they both need each other.

@GillesDebunne: cross dependency should be broken, not sure what is better as I don't know how code was designed. My understanding is that NVector3 is just for having normalized vector so removing NVector3 but adding a bool normalized member in Vector3 could break the cross dependency (?) and allow easy define/implementation/link with all kind of operators (which will then need to be defined only once)

/usr/bin/ld: libQGLViewer.so: undefined reference to `vrender::operator*(vrender::Vector3 const&, vrender::NVector3 const&)'
/usr/bin/ld: libQGLViewer.so: undefined reference to `vrender::operator<<(std::ostream&, vrender::Vector3 const&)'
/usr/bin/ld: libQGLViewer.so: undefined reference to `vrender::operator-(vrender::Vector2 const&)'
/usr/bin/ld: libQGLViewer.so: undefined reference to `vrender::operator*(double, vrender::Vector3 const&)'
/usr/bin/ld: libQGLViewer.so: undefined reference to `vrender::operator*(vrender::NVector3 const&, vrender::Vector3 const&)'
collect2: error: ld returned 1 exit status

@fghoussen
Copy link
Contributor Author

The last warnings are Qt deprecation which fix may depend on version Qt5/6...
Would be good to get rid of -Wno-error=deprecated-declarations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant