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

Fix build warnings #251

Closed
jmarrec opened this issue Oct 13, 2020 · 0 comments
Closed

Fix build warnings #251

jmarrec opened this issue Oct 13, 2020 · 0 comments

Comments

@jmarrec
Copy link
Collaborator

jmarrec commented Oct 13, 2020

Issue overview

Building on macOS 10.15.7 with xcode 12, I'm getting warnings I don't get on gcc 7 (Ubuntu 18.04) and they make a lot of sense

[ 38%][308/790] Building CXX object src/openstudio_lib/CMakeFiles/openstudio_lib.dir/OSItem.cpp.o
/Users/dev/git/OpenStudioApplication/src/openstudio_lib/OSItem.cpp:504:26: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
  if (!(event->buttons() && Qt::LeftButton)) {
                         ^  ~~~~~~~~~~~~~~
/Users/dev/git/OpenStudioApplication/src/openstudio_lib/OSItem.cpp:504:26: note: use '&' for a bitwise operation
  if (!(event->buttons() && Qt::LeftButton)) {
                         ^~
                         &
/Users/dev/git/OpenStudioApplication/src/openstudio_lib/OSItem.cpp:504:26: note: remove constant to silence this warning
  if (!(event->buttons() && Qt::LeftButton)) {
                        ~^~~~~~~~~~~~~~~~~
1 warning generated.

Details

**Click to expand build log**
[  2%][18/790] Generating moc_Utilities.cxx
/Users/dev/git/OpenStudioApplication/src/model_editor/Utilities.hpp:0: Note: No relevant classes found. No output generated.
[  7%][58/790] Linking CXX static library Products/libopenstudio_modeleditor.a
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: Products/libopenstudio_modeleditor.a(moc_Utilities.cxx.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: Products/libopenstudio_modeleditor.a(moc_Utilities.cxx.o) has no symbols
[ 38%][308/790] Building CXX object src/openstudio_lib/CMakeFiles/openstudio_lib.dir/OSItem.cpp.o
/Users/dev/git/OpenStudioApplication/src/openstudio_lib/OSItem.cpp:504:26: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
  if (!(event->buttons() && Qt::LeftButton)) {
                         ^  ~~~~~~~~~~~~~~
/Users/dev/git/OpenStudioApplication/src/openstudio_lib/OSItem.cpp:504:26: note: use '&' for a bitwise operation
  if (!(event->buttons() && Qt::LeftButton)) {
                         ^~
                         &
/Users/dev/git/OpenStudioApplication/src/openstudio_lib/OSItem.cpp:504:26: note: remove constant to silence this warning
  if (!(event->buttons() && Qt::LeftButton)) {
                        ~^~~~~~~~~~~~~~~~~
1 warning generated.
[ 45%][358/790] Building CXX object src/openstudio_lib/CMakeFiles/openstudio_lib.dir/SpacesSubsurfacesGridView.cpp.o
/Users/dev/git/OpenStudioApplication/src/openstudio_lib/SpacesSubsurfacesGridView.cpp:352:72: warning: 'shadingControl' is deprecated [-Wdeprecated-declarations]
            auto shadingControl = subSurface.cast<model::SubSurface>().shadingControl();
                                                                       ^
OpenStudio-3.1.0/OpenStudio-3.1.0-rc2+527967526b-Darwin/include/openstudio/model/SubSurface.hpp:96:3: note: 'shadingControl' has been explicitly marked deprecated here
  OS_DEPRECATED boost::optional<ShadingControl> shadingControl() const;
  ^
OpenStudio-3.1.0/OpenStudio-3.1.0-rc2+527967526b-Darwin/include/openstudio/model/../utilities/core/Deprecated.hpp:40:40: note: expanded from macro 'OS_DEPRECATED'
  #define OS_DEPRECATED __attribute__((deprecated))
                                       ^
/Users/dev/git/OpenStudioApplication/src/openstudio_lib/SpacesSubsurfacesGridView.cpp:443:120: warning: 'shadingControl' is deprecated [-Wdeprecated-declarations]
        addDropZoneColumn(Heading(QString(SHADINGCONTROLNAME)), CastNullAdapter<model::SubSurface>(&model::SubSurface::shadingControl), setter,
                                                                                                                       ^
OpenStudio-3.1.0/OpenStudio-3.1.0-rc2+527967526b-Darwin/include/openstudio/model/SubSurface.hpp:96:3: note: 'shadingControl' has been explicitly marked deprecated here
  OS_DEPRECATED boost::optional<ShadingControl> shadingControl() const;
  ^
OpenStudio-3.1.0/OpenStudio-3.1.0-rc2+527967526b-Darwin/include/openstudio/model/../utilities/core/Deprecated.hpp:40:40: note: expanded from macro 'OS_DEPRECATED'
  #define OS_DEPRECATED __attribute__((deprecated))
                                       ^
/Users/dev/git/OpenStudioApplication/src/openstudio_lib/SpacesSubsurfacesGridView.cpp:444:116: warning: 'resetShadingControl' is deprecated [-Wdeprecated-declarations]
                          boost::optional<std::function<void(model::SubSurface*)>>(NullAdapter(&model::SubSurface::resetShadingControl)),
                                                                                                                   ^
OpenStudio-3.1.0/OpenStudio-3.1.0-rc2+527967526b-Darwin/include/openstudio/model/SubSurface.hpp:139:3: note: 'resetShadingControl' has been explicitly marked deprecated here
  OS_DEPRECATED void resetShadingControl();
  ^
OpenStudio-3.1.0/OpenStudio-3.1.0-rc2+527967526b-Darwin/include/openstudio/model/../utilities/core/Deprecated.hpp:40:40: note: expanded from macro 'OS_DEPRECATED'
  #define OS_DEPRECATED __attribute__((deprecated))
                                       ^
3 warnings generated.
[ 53%][420/790] Building CXX object src/openstudio_lib/CMakeFiles/openstudio_lib.dir/__/shared_gui_components/OSDragableView.cpp.o
/Users/dev/git/OpenStudioApplication/src/shared_gui_components/OSDragableView.cpp:61:26: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
  if (!(event->buttons() && Qt::LeftButton)) {
                         ^  ~~~~~~~~~~~~~~
/Users/dev/git/OpenStudioApplication/src/shared_gui_components/OSDragableView.cpp:61:26: note: use '&' for a bitwise operation
  if (!(event->buttons() && Qt::LeftButton)) {
                         ^~
                         &
/Users/dev/git/OpenStudioApplication/src/shared_gui_components/OSDragableView.cpp:61:26: note: remove constant to silence this warning
  if (!(event->buttons() && Qt::LeftButton)) {
                        ~^~~~~~~~~~~~~~~~~
1 warning generated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant