Opened 4 years ago

Closed 4 years ago

#60549 closed defect (fixed)

GLC_lib @2.2.0: error: non-constant-expression cannot be narrowed

Reported by: kencu (Ken) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: GLC_lib

Description

Likely an issue caused by building with the newer clang-9.0 that is the default on 10.6.8.

See:

<https://build.macports.org/builders/ports-10.6_x86_64-builder/builds/27038/steps/install-port/logs/stdio>

Change History (2)

comment:1 Changed 4 years ago by kencu (Ken)

/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....

comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In 1cc7f6ca51d49dec73f1a0e70c1109bdbd292392/macports-ports (master):

GLC_lib: Specify C++03 standard

Closes: #60549

Note: See TracTickets for help on using tickets.