Quantcast

[MacPorts] #54183: qt4-mac @4.8.7: build failures with clang-4.0 due to comparison between pointer and zero

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[MacPorts] #54183: qt4-mac @4.8.7: build failures with clang-4.0 due to comparison between pointer and zero

MacPorts
#54183: qt4-mac @4.8.7: build failures with clang-4.0 due to comparison between
pointer and zero
--------------------+---------------------
 Reporter:  kencu   |      Owner:
     Type:  defect  |     Status:  new
 Priority:  Normal  |  Milestone:
Component:  ports   |    Version:
 Keywords:          |       Port:  qt4-mac
--------------------+---------------------
 Apparently clang-4.0 has elevated a test like:
 {{{
 if (somepointer > 0)
 }}}
 to an error. <https://github.com/ZoneMinder/ZoneMinder/issues/1760>

 I suspect this will probably result in a number of builds breaking, but so
 far in building qt4-mac there have been a couple, and I'm just getting
 into it. I'm going to go back to clang-3.9 to build this, while we sort
 out all the errors over time.

 Perhaps there is a flag to turn this off.

 {{{
 In file:
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work
 /qt-everywhere-opensource-
 src-4.8.7/src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp

 ../JavaScriptCore/runtime/JSTypeInfo.h:73:52: note: remove constant to
 silence this warning
         unsigned isFinal() const { return m_flags2 && (IsJSFinalObject >>
 8); }
 ~^~~~~~~~~~~~~~~~~~~~~~~~~
 html/HTMLImageElement.cpp:77:24: error: ordered comparison between pointer
 and zero ('const int *' and 'int')
     if (optionalHeight > 0)
 }}}

 and
 {{{
 /opt/local/bin/clang++-mp-4.0 -c -pipe -Os -stdlib=libc++ -Xarch_i386
 -mmacosx-version-min=10.6 -Xarch_x86_64 -mmacosx-version-min=10.6 -O2
 -Wall -W -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.6 -arch i386
 -DPROEVALUATOR_CUMULATIVE -DPROEVALUATOR_INIT_PROPS -DQT_NO_CAST_TO_ASCII
 -DQT_NO_CAST_FROM_ASCII -DQT_NO_DEBUG -DQT_XML_LIB -DQT_CORE_LIB
 -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT
 -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1
 -DQT_HAVE_SSE4_2 -DQT_HAVE_AVX -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE
 -DQT_SHARED -I../../../mkspecs/macx-g++ -I. -I.moc/release-shared
 -I../../../lib/QtCore.framework/Versions/4/Headers
 -I../../../lib/QtXml.framework/Versions/4/Headers -I../shared
 -I../../../src/declarative/qml/parser -I../../../src/declarative/qml
 -I../../../include/QtDeclarative -I../../../include/QtXml
 -I../../../include/QtCore -I../../../include
 -F/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work
 /qt-everywhere-opensource-src-4.8.7/Library/Frameworks
 -F/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work
 /qt-everywhere-opensource-src-4.8.7/lib -o .obj/release-shared/qscript.o
 qscript.cpp
 /opt/local/bin/clang++-mp-4.0 -c -pipe -Os -stdlib=libc++ -Xarch_i386
 -mmacosx-version-min=10.6 -Xarch_x86_64 -mmacosx-version-min=10.6 -O2
 -Wall -W -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.6 -arch i386
 -DPROEVALUATOR_CUMULATIVE -DPROEVALUATOR_INIT_PROPS -DQT_NO_CAST_TO_ASCII
 -DQT_NO_CAST_FROM_ASCII -DQT_NO_DEBUG -DQT_XML_LIB -DQT_CORE_LIB
 -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT
 -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1
 -DQT_HAVE_SSE4_2 -DQT_HAVE_AVX -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE
 -DQT_SHARED -I../../../mkspecs/macx-g++ -I. -I.moc/release-shared
 -I../../../lib/QtCore.framework/Versions/4/Headers
 -I../../../lib/QtXml.framework/Versions/4/Headers -I../shared
 -I../../../src/declarative/qml/parser -I../../../src/declarative/qml
 -I../../../include/QtDeclarative -I../../../include/QtXml
 -I../../../include/QtCore -I../../../include
 -F/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work
 /qt-everywhere-opensource-src-4.8.7/Library/Frameworks
 -F/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work
 /qt-everywhere-opensource-src-4.8.7/lib -o .obj/release-
 shared/qdeclarative.o qdeclarative.cpp
 /opt/local/bin/clang++-mp-4.0 -c -pipe -Os -stdlib=libc++ -Xarch_i386
 -mmacosx-version-min=10.6 -Xarch_x86_64 -mmacosx-version-min=10.6 -O2
 -Wall -W -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.6 -arch i386
 -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQFORMINTERNAL_NAMESPACE
 -DQT_KEYWORDS -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB
 -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT
 -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1
 -DQT_HAVE_SSE4_2 -DQT_HAVE_AVX -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE
 -DQT_SHARED -I../../../mkspecs/macx-g++ -I. -I.moc/release-shared
 -I../../../include/QtUiTools
 -I../../../lib/QtCore.framework/Versions/4/Headers
 -I../../../lib/QtGui.framework/Versions/4/Headers
 -I../../../lib/QtXml.framework/Versions/4/Headers -I../shared
 -I../../designer/src/uitools -I../../designer/src/lib/uilib
 -I../../../include/QtXml -I../../../include/QtGui
 -I../../../include/QtCore -I../../../include -I.uic/release-shared
 -F/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work
 /qt-everywhere-opensource-src-4.8.7/Library/Frameworks
 -F/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work
 /qt-everywhere-opensource-src-4.8.7/lib -o .obj/release-
 shared/messagemodel.o messagemodel.cpp
 In file included from qdeclarative.cpp:51:
 ../../../src/declarative/qml/parser/qdeclarativejsparser_p.h:175:17:
 warning: logical not is only applied to the left hand side of this
 comparison [-Wlogical-not-parentheses]
             if (! d.kind == DiagnosticMessage::Warning)
                 ^        ~~
 ../../../src/declarative/qml/parser/qdeclarativejsparser_p.h:175:17: note:
 add parentheses after the '!' to evaluate the comparison first
             if (! d.kind == DiagnosticMessage::Warning)
                 ^
                   (                                   )
 ../../../src/declarative/qml/parser/qdeclarativejsparser_p.h:175:17: note:
 add parentheses around left hand side expression to silence this warning
             if (! d.kind == DiagnosticMessage::Warning)
                 ^
                 (       )
 1 warning generated.
 messagemodel.cpp:186:61: error: ordered comparison between pointer and
 zero ('MessageItem *' and 'int')
                 if (c->findMessage(m->text(), m->comment()) >= 0)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~
 1 error generated.
 }}}

--
Ticket URL: <https://trac.macports.org/ticket/54183>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #54183: qt4-mac @4.8.7: build failures with clang-4.0 due to comparison between pointer and zero

MacPorts
#54183: qt4-mac @4.8.7: build failures with clang-4.0 due to comparison between
pointer and zero
----------------------+-----------------
  Reporter:  kencu    |      Owner:
      Type:  defect   |     Status:  new
  Priority:  Normal   |  Milestone:
 Component:  ports    |    Version:
Resolution:           |   Keywords:
      Port:  qt4-mac  |
----------------------+-----------------

Comment (by michaelld):

 I was always taught to just do
 {{{
 if (pointer) ...
 }}}
 which implicitly compares it with whatever type of 0 the pointer is.
 That's been valid in C since I started using it, gotta be 30 years now. As
 far as I know, it's still valid in C or C++. Maybe frowned upon by modern
 standards which might use C++11's nullptr. Not sure what the equivalent in
 C is.

 Can you do a simple program & test to see if this works on your 10.6
 setup?

 If so, then I'd say to patch those explicit comparisons with 0 to be this
 type. Single patch would do.

--
Ticket URL: <https://trac.macports.org/ticket/54183#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #54183: qt4-mac @4.8.7: build failures with clang-4.0 due to comparison between pointer and zero

MacPorts
In reply to this post by MacPorts
#54183: qt4-mac @4.8.7: build failures with clang-4.0 due to comparison between
pointer and zero
----------------------+-----------------
  Reporter:  kencu    |      Owner:
      Type:  defect   |     Status:  new
  Priority:  Normal   |  Milestone:
 Component:  ports    |    Version:
Resolution:           |   Keywords:
      Port:  qt4-mac  |
----------------------+-----------------

Comment (by devernay):

 See also [https://svnweb.freebsd.org/ports/branches/2017Q1/www/webkit-
 qt4/files/patch-
 src_3rdparty_webkit_Source_WebCore_html_HTMLImageElement.cpp?view=markup&pathrev=431846
 FreeBSD revision 431846]

 patch: [https://svnweb.freebsd.org/ports/branches/2017Q1/www/webkit-
 qt4/files/patch-
 src_3rdparty_webkit_Source_WebCore_html_HTMLImageElement.cpp?revision=431846&view=co&pathrev=431846
 FreeBSD revision 431846 patch]

--
Ticket URL: <https://trac.macports.org/ticket/54183#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #54183: qt4-mac @4.8.7: build failures with clang-4.0 due to comparison between pointer and zero

MacPorts
In reply to this post by MacPorts
#54183: qt4-mac @4.8.7: build failures with clang-4.0 due to comparison between
pointer and zero
----------------------+-----------------
  Reporter:  kencu    |      Owner:
      Type:  defect   |     Status:  new
  Priority:  Normal   |  Milestone:
 Component:  ports    |    Version:
Resolution:           |   Keywords:
      Port:  qt4-mac  |
----------------------+-----------------

Comment (by michaelld):

 @deverney: Intersting & good to know.

 Does anyone have a list of these strange pointer comparisons? I'm trying
 to get clang-4.0 going on my 10.8 (libstdc++) install to see if I can see
 these myself. Maybe someone else already has this info?

--
Ticket URL: <https://trac.macports.org/ticket/54183#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #54183: qt4-mac @4.8.7: build failures with clang-4.0 due to comparison between pointer and zero

MacPorts
In reply to this post by MacPorts
#54183: qt4-mac @4.8.7: build failures with clang-4.0 due to comparison between
pointer and zero
----------------------+-----------------
  Reporter:  kencu    |      Owner:
      Type:  defect   |     Status:  new
  Priority:  Normal   |  Milestone:
 Component:  ports    |    Version:
Resolution:           |   Keywords:
      Port:  qt4-mac  |
----------------------+-----------------

Comment (by kencu):

 You should see the same errors on all systems that try to build it with
 clang-4.0+

--
Ticket URL: <https://trac.macports.org/ticket/54183#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #54183: qt4-mac @4.8.7: build failures with clang-4.0 due to comparison between pointer and zero

MacPorts
In reply to this post by MacPorts
#54183: qt4-mac @4.8.7: build failures with clang-4.0 due to comparison between
pointer and zero
----------------------+-----------------
  Reporter:  kencu    |      Owner:
      Type:  defect   |     Status:  new
  Priority:  Normal   |  Milestone:
 Component:  ports    |    Version:
Resolution:           |   Keywords:
      Port:  qt4-mac  |
----------------------+-----------------

Comment (by michaelld):

 LOL doesn't work on 10.12 for me using libc++. Errors out linking qmake,
 with the following for 3 different system libraries, just like this ticket
 #51701 .

 I'm getting there with 10.8. Just takes time to get everything installed.

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