Opened 10 years ago

Closed 6 years ago

#43895 closed defect (worksforme)

xercesc3 does not build when using c++11

Reported by: gallafent Owned by: nerdling (Jeremy Lavergne)
Priority: Normal Milestone:
Component: ports Version: 2.3.0
Keywords: haspatch Cc: nerdling (Jeremy Lavergne), scantor (Scott Cantor)
Port: xercesc3

Description

Using the configure line:

sudo port install xercesc3 configure.cxx_stdlib=libc++ configure.cxxflags=-std=c++11 \
configure.macosx_deployment_target=10.7 \
configure.sdkroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk

… the build fails with the following error:

:info:build xercesc/util/regx/ParserForXMLSchema.cpp:159:42: error: non-constant-expression cannot be narrowed from type 'XMLInt32' (aka 'int') to 'XMLCh' (aka 'unsigned short') in initializer list [-Wc++11-narrowing]
:info:build         XMLCh chString[] = {chBackSlash, ch, chNull};        
:info:build                                          ^~
:info:build xercesc/util/regx/ParserForXMLSchema.cpp:159:42: note: override this message by inserting an explicit cast
:info:build         XMLCh chString[] = {chBackSlash, ch, chNull};        
:info:build                                          ^~
:info:build                                          static_cast<XMLCh>( )
:info:build 1 error generated.
:info:build make[4]: *** [xercesc/util/regx/ParserForXMLSchema.lo] Error 1

I assume the easy patch as suggested by clang will be appropriate.

Attachments (5)

Portfile.diff (646 bytes) - added by gallafent 10 years ago.
Applies the patches which I am about to attach
patch-src-xercesc-util-regx-ParserForXMLSchema.cpp.diff (490 bytes) - added by gallafent 10 years ago.
Remove C++11 narrowing error
patch-src-xercesc-util-regx-RegxParser.cpp.diff (2.0 KB) - added by gallafent 10 years ago.
Remove C++11 narrowing error
patch-src-xercesc-util-XMLUTF8Transcoder.cpp.diff (2.6 KB) - added by gallafent 10 years ago.
Remove C++11 narrowing error
patch-src-xercesc-util-XMLUTF8Transcoder.hpp.diff (521 bytes) - added by gallafent 10 years ago.
Remove C++11 narrowing error

Download all attachments as: .zip

Change History (13)

Changed 10 years ago by gallafent

Attachment: Portfile.diff added

Applies the patches which I am about to attach

Changed 10 years ago by gallafent

Remove C++11 narrowing error

Changed 10 years ago by gallafent

Remove C++11 narrowing error

Changed 10 years ago by gallafent

Remove C++11 narrowing error

Changed 10 years ago by gallafent

Remove C++11 narrowing error

comment:1 Changed 10 years ago by gallafent

Attached patches allow successful build with C++11.

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

Keywords: haspatch added

comment:3 Changed 10 years ago by gallafent

Note that this is also fixed upstream, and is scheduled for the Xerces-C++ 3.2.0 release. I couldn't find any information about when that release is expected to occur though, so it would seem prudent for us to patch here in the mean time.

https://issues.apache.org/jira/browse/XERCESC-1995

comment:4 in reply to:  description Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to william@…:

Using the configure line:

sudo port install xercesc3 configure.cxx_stdlib=libc++ configure.cxxflags=-std=c++11 \
configure.macosx_deployment_target=10.7 \
configure.sdkroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk

… the build fails with the following error:

Why add all these flags? The port builds fine for me when I just run "sudo port install xercesc3".

comment:5 Changed 10 years ago by nerdling (Jeremy Lavergne)

Owner: changed from macports-tickets@… to snc@…
Status: newassigned

comment:6 Changed 6 years ago by nerdling (Jeremy Lavergne)

Using solely the configure.cxx* args, I'm able to build this without any errors on 10.13.

That is, simply sudo port install xercesc3 configure.cxx_stdlib=libc++ configure.cxxflags=-std=c++11 appears to work.

Are these patches still needed?

comment:7 Changed 6 years ago by scantor (Scott Cantor)

It's very likely they were fixed as part of 3.2.0 or 3.2.1.

comment:8 Changed 6 years ago by nerdling (Jeremy Lavergne)

Resolution: worksforme
Status: assignedclosed
Note: See TracTickets for help on using tickets.