[MacPorts] #60549: GLC_lib @2.2.0: error: non-constant-expression cannot be narrowed

MacPorts noreply at macports.org
Sat May 23 18:52:03 UTC 2020


#60549: GLC_lib @2.2.0: error: non-constant-expression cannot be narrowed
----------------------+--------------------
  Reporter:  kencu    |      Owner:  (none)
      Type:  defect   |     Status:  new
  Priority:  Normal   |  Milestone:
 Component:  ports    |    Version:
Resolution:           |   Keywords:
      Port:  GLC_lib  |
----------------------+--------------------

Comment (by kencu):

 {{{
 /opt/local/bin/clang++-mp-9.0 -c -Os -stdlib=libc++ -arch x86_64 -O2 -arch
 x86_64 -Xarch_x86_64 -mmacosx-version-min=10.6 -Wall -W -fPIC
 -DCREATE_GLC_LIB_DLL -DLIB3DS_EXPORTS -D_CRT_SECURE_NO_WARNINGS
 -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
 -I/opt/local/libexec/qt4/share/mkspecs/macx-g++ -I. -IBuild
 -I/opt/local/libexec/qt4/Library/Frameworks/QtCore.framework/Versions/4/Headers
 -I/opt/local/libexec/qt4/Library/Frameworks/QtGui.framework/Versions/4/Headers
 -I/opt/local/libexec/qt4/Library/Frameworks/QtOpenGL.framework/Versions/4/Headers
 -I. -I3rdparty/zlib
 -I/opt/local/libexec/qt4/Library/Frameworks/QtOpenGL.framework/Versions/4/Headers
 -I/opt/local/libexec/qt4/Library/Frameworks/QtGui.framework/Versions/4/Headers
 -I/opt/local/libexec/qt4/Library/Frameworks/QtCore.framework/Versions/4/Headers
 -I/opt/local/libexec/qt4/include
 -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers
 -I/System/Library/Frameworks/AGL.framework/Headers
 -F/opt/local/libexec/qt4/Library/Frameworks -F/opt/local/libexec/qt4/lib
 -o Build/glc_camera.o viewport/glc_camera.cpp
 shading/glc_material.cpp:480:29: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
         GLfloat pAmbientColor[4]= {ambientColor().redF(),
                                    ^~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:480:29: note: insert an explicit cast to silence
 this issue
         GLfloat pAmbientColor[4]= {ambientColor().redF(),
                                    ^~~~~~~~~~~~~~~~~~~~~
                                    static_cast<GLfloat>()
 shading/glc_material.cpp:481:9: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
 ambientColor().greenF(),
 ^~~~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:481:9: note: insert an explicit cast to silence
 this issue
 ambientColor().greenF(),
 ^~~~~~~~~~~~~~~~~~~~~~~
 static_cast<GLfloat>(  )
 shading/glc_material.cpp:482:9: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
 ambientColor().blueF(),
 ^~~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:482:9: note: insert an explicit cast to silence
 this issue
 ambientColor().blueF(),
 ^~~~~~~~~~~~~~~~~~~~~~
 static_cast<GLfloat>( )
 shading/glc_material.cpp:483:9: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
 ambientColor().alphaF()};
 ^~~~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:483:9: note: insert an explicit cast to silence
 this issue
 ambientColor().alphaF()};
 ^~~~~~~~~~~~~~~~~~~~~~~
 static_cast<GLfloat>(  )
 shading/glc_material.cpp:485:29: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
         GLfloat pDiffuseColor[4]= {diffuseColor().redF(),
                                    ^~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:485:29: note: insert an explicit cast to silence
 this issue
         GLfloat pDiffuseColor[4]= {diffuseColor().redF(),
                                    ^~~~~~~~~~~~~~~~~~~~~
                                    static_cast<GLfloat>()
 shading/glc_material.cpp:486:9: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
 diffuseColor().greenF(),
 ^~~~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:486:9: note: insert an explicit cast to silence
 this issue
 diffuseColor().greenF(),
 ^~~~~~~~~~~~~~~~~~~~~~~
 static_cast<GLfloat>(  )
 shading/glc_material.cpp:487:9: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
 diffuseColor().blueF(),
 ^~~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:487:9: note: insert an explicit cast to silence
 this issue
 diffuseColor().blueF(),
 ^~~~~~~~~~~~~~~~~~~~~~
 static_cast<GLfloat>( )
 shading/glc_material.cpp:488:9: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
 diffuseColor().alphaF()};
 ^~~~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:488:9: note: insert an explicit cast to silence
 this issue
 diffuseColor().alphaF()};
 ^~~~~~~~~~~~~~~~~~~~~~~
 static_cast<GLfloat>(  )
 shading/glc_material.cpp:490:30: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
         GLfloat pSpecularColor[4]= {specularColor().redF(),
                                     ^~~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:490:30: note: insert an explicit cast to silence
 this issue
         GLfloat pSpecularColor[4]= {specularColor().redF(),
                                     ^~~~~~~~~~~~~~~~~~~~~~
                                     static_cast<GLfloat>( )
 shading/glc_material.cpp:491:9: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
 specularColor().greenF(),
 ^~~~~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:491:9: note: insert an explicit cast to silence
 this issue
 specularColor().greenF(),
 ^~~~~~~~~~~~~~~~~~~~~~~~
 static_cast<GLfloat>(   )
 shading/glc_material.cpp:492:9: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
 specularColor().blueF(),
 ^~~~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:492:9: note: insert an explicit cast to silence
 this issue
 specularColor().blueF(),
 ^~~~~~~~~~~~~~~~~~~~~~~
 static_cast<GLfloat>(  )
 shading/glc_material.cpp:493:9: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
 specularColor().alphaF()};
 ^~~~~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:493:9: note: insert an explicit cast to silence
 this issue
 specularColor().alphaF()};
 ^~~~~~~~~~~~~~~~~~~~~~~~
 static_cast<GLfloat>(   )
 shading/glc_material.cpp:495:30: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
         GLfloat pLightEmission[4]= {emissiveColor().redF(),
                                     ^~~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:495:30: note: insert an explicit cast to silence
 this issue
         GLfloat pLightEmission[4]= {emissiveColor().redF(),
                                     ^~~~~~~~~~~~~~~~~~~~~~
                                     static_cast<GLfloat>( )
 shading/glc_material.cpp:496:9: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
 emissiveColor().greenF(),
 ^~~~~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:496:9: note: insert an explicit cast to silence
 this issue
 emissiveColor().greenF(),
 ^~~~~~~~~~~~~~~~~~~~~~~~
 static_cast<GLfloat>(   )
 shading/glc_material.cpp:497:9: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
 emissiveColor().blueF(),
 ^~~~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:497:9: note: insert an explicit cast to silence
 this issue
 emissiveColor().blueF(),
 ^~~~~~~~~~~~~~~~~~~~~~~
 static_cast<GLfloat>(  )
 shading/glc_material.cpp:498:9: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
 emissiveColor().alphaF()};
 ^~~~~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:498:9: note: insert an explicit cast to silence
 this issue
 emissiveColor().alphaF()};
 ^~~~~~~~~~~~~~~~~~~~~~~~
 static_cast<GLfloat>(   )
 shading/glc_material.cpp:551:29: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
         GLfloat pAmbientColor[4]= {ambientColor().redF(),
                                    ^~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:551:29: note: insert an explicit cast to silence
 this issue
         GLfloat pAmbientColor[4]= {ambientColor().redF(),
                                    ^~~~~~~~~~~~~~~~~~~~~
                                    static_cast<GLfloat>()
 shading/glc_material.cpp:552:9: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
 ambientColor().greenF(),
 ^~~~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:552:9: note: insert an explicit cast to silence
 this issue
 ambientColor().greenF(),
 ^~~~~~~~~~~~~~~~~~~~~~~
 static_cast<GLfloat>(  )
 shading/glc_material.cpp:553:9: error: non-constant-expression cannot be
 narrowed from type 'qreal' (aka 'double') to 'GLfloat' (aka 'float') in
 initializer list [-Wc++11-narrowing]
 ambientColor().blueF(),
 ^~~~~~~~~~~~~~~~~~~~~~
 shading/glc_material.cpp:553:9: note: insert an explicit cast to silence
 this issue
 ambientColor().blueF(),
 ^~~~~~~~~~~~~~~~~~~~~~
 static_cast<GLfloat>( )
 fatal error: too many errors emitted, stopping now [-ferror-limit=]
 20 errors generated.
 make: *** [Build/glc_material.o] Error 1
 make: *** Waiting for unfinished jobs....
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/60549#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list