Skip Menu |

This queue is for tickets about the Algorithm-ConstructDFA CPAN distribution.

Report information
The Basics
Id: 92978
Status: resolved
Priority: 0/
Queue: Algorithm-ConstructDFA

People
Owner: BJOERN [...] cpan.org
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Algorithm-ConstructDFA-XS: support for clang++
(Sorry for misusing the wrong RT queue, but https://rt.cpan.org/Public/Dist/Display.html?Name=Algorithm-ConstructDFA-XS does not exist yet) On a FreeBSD 10 system, which comes by default with clang instead of gcc, building Algorithm-ConstructDFA-XS fails: $ make g++ -std=c++0x -gdwarf-2 -c -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O -DVERSION=\"0.03\" -DXS_VERSION=\"0.03\" -DPIC -fPIC "-I/usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE" ConstructDFA.c g++: not found This can be fixed by using "c++" instead of "g++", which should work for both gcc and clang. However, this also fails, but looks like it can easily be fixed: $ make "CC=c++ -std=c++0x -gdwarf-2" "LD=c++ -gdwarf-2" c++ -std=c++0x -gdwarf-2 -c -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O -DVERSION=\"0.03\" -DXS_VERSION=\"0.03\" -DPIC -fPIC "-I/usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE" ConstructDFA.c c++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated In file included from ConstructDFA.xs:17: In file included from /usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/perl.h:3476: /usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/pad.h:323:17: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal] "Pad 0x%"UVxf"[0x%"UVxf"] set_cur depth=%d\n", \ ^ /usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/pad.h:323:27: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal] "Pad 0x%"UVxf"[0x%"UVxf"] set_cur depth=%d\n", \ ^ /usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/pad.h:341:17: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal] "Pad 0x%"UVxf"[0x%"UVxf"] save_local\n", \ ^ /usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/pad.h:341:27: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal] "Pad 0x%"UVxf"[0x%"UVxf"] save_local\n", \ ^ /usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/pad.h:349:17: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal] "Pad 0x%"UVxf"[0x%"UVxf"] restore_local\n", \ ^ /usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/pad.h:349:27: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal] "Pad 0x%"UVxf"[0x%"UVxf"] restore_local\n", \ ^ In file included from ConstructDFA.xs:17: /usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/perl.h:4257:37: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal] INIT("Use of uninitialized value%"SVf"%s%s"); ^ /usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/perl.h:4277:75: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal] INIT("Modification of non-creatable hash value attempted, subscript \"%"SVf"\""); ^ ConstructDFA.c:614:1: warning: duplicate 'extern' declaration specifier [-Wduplicate-decl-specifier] XS_EXTERNAL(boot_Algorithm__ConstructDFA__XS); /* prototype to pass -Wmissing-prototypes */ ^ /usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/XSUB.h:145:33: note: expanded from macro 'XS_EXTERNAL' # define XS_EXTERNAL(name) extern "C" XSPROTO(name) ^ 1 warning and 8 errors generated. *** Error code 1 Stop. Regards, Slaven
Subject: Re: [rt.cpan.org #92978] Algorithm-ConstructDFA-XS: support for clang++
Date: Thu, 13 Feb 2014 15:24:01 +0100
To: bug-Algorithm-ConstructDFA [...] rt.cpan.org
From: Bjoern Hoehrmann <derhoermi [...] gmx.net>
* Slaven_Rezic via RT wrote: Show quoted text
>On a FreeBSD 10 system, which comes by default with clang instead of gcc, building Algorithm-ConstructDFA-XS fails: > >$ make >g++ -std=c++0x -gdwarf-2 -c -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O -DVERSION=\"0.03\" -DXS_VERSION=\"0.03\" -DPIC -fPIC "-I/usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE" ConstructDFA.c >g++: not found > >This can be fixed by using "c++" instead of "g++", which should work for both gcc and clang.
Interesting. I guess I could try that. I would love to use a module that picks the right compiler automatically for me, but I could find nothing suitable on CPAN, so this is semi-hardcoded in Makefile.PL currently. Show quoted text
>However, this also fails, but looks like it can easily be fixed: > >$ make "CC=c++ -std=c++0x -gdwarf-2" "LD=c++ -gdwarf-2" >c++ -std=c++0x -gdwarf-2 -c -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O -DVERSION=\"0.03\" -DXS_VERSION=\"0.03\" -DPIC -fPIC "-I/usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE" ConstructDFA.c >c++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
I am not sure what this warning means. Show quoted text
>In file included from ConstructDFA.xs:17: >In file included from /usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/perl.h:3476: >/usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/pad.h:323:17: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal] > "Pad 0x%"UVxf"[0x%"UVxf"] set_cur depth=%d\n", \ > ^
These errors are complaining about Perl headers. I am not sure why they are subjected to C++11 rules (obviously only my .xs code is C++, not the Perl headers) rather than C rules, and I do not see what I could do to fix this. I can't find other CPAN modules that use `-std=c++0x`. -- Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de 25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
This got fixed in Perl https://rt.perl.org/Public/Bug/Display.html?id=120670 -- nothing left to do for me. Thanks.