New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VC6 has missing ')'s on macro expansion, cBOOL and U8, Unicode.xs #13697
Comments
From @bulk88Created by @bulk88jdb on #p5p complained today that compiling blead with VC6 gave (from --------------------------------------------------------------- I got the same thing with VC6. There are missing )s in the Move macro ((void) Encode-Unicode has strange line called "#define U8 U8" which is from I cut the bug down into the attached uni3.c. On VC6. usage: cl [ option... ] filename... [ /link linkoption... ] C:\perl519\src\cpan\Encode\Unicode>type uni3.c Move(source,dest,len,U8); C:\perl519\src\cpan\Encode\Unicode>cl -P Uni3.c Uni3.c C:\perl519\src\cpan\Encode\Unicode>type uni3.i ((void)((((sizeof(U8> 1 && ((MEM_SIZE)(len)+0.0) > C:\perl519\src\cpan\Encode\Unicode>type uni3.c Move(source,dest,len,U8); C:\perl519\src\cpan\Encode\Unicode>cl -P Uni3.c Uni3.c C:\perl519\src\cpan\Encode\Unicode>type uni3.i ((void)((((sizeof(U8) > 1 && ((MEM_SIZE)(len)+0.0) > C:\perl519\src\cpan\Encode\Unicode>type uni3.c Move(source,dest,len,U8); C:\perl519\src\cpan\Encode\Unicode>cl -P Uni3.c Uni3.c C:\perl519\src\cpan\Encode\Unicode>type uni3.i ((void)((cBOOL(sizeof(U8) > 1 && ((MEM_SIZE)(len)+0.0) > C:\perl519\src\cpan\Encode\Unicode> VC7/VC 2003 are fine. ---------------------------------------------------------------------------- C:\perl519\src\cpan\Encode\Unicode>cl usage: cl [ option... ] filename... [ /link linkoption... ] C:\perl519\src\cpan\Encode\Unicode>type uni3.c Move(source,dest,len,U8); C:\perl519\src\cpan\Encode\Unicode>cl -P uni3.c uni3.c C:\perl519\src\cpan\Encode\Unicode>type uni3.i ((void)((((sizeof(U8) > 1 && ((MEM_SIZE)(len)+0.0) > C:\perl519\src\cpan\Encode\Unicode> This sounds like something bisectable because I built VC6 builds a Changing "#define U8 U8" to "#define U8 U81" fixes the bug. IDK if this is related Anyone have tweaks/permutations to the sample uni3.c file for me to try Perl Info
|
From @bulk88#define cBOOL(cbool) ((cbool) ? (bool)1 : (bool)0) Move(source,dest,len,U8); |
From @steve-m-hayOn 1 April 2014 05:02, bulk88 <perlbug-followup@perl.org> wrote:
[...]
Bisected to: 5d9574c (davem): Adding this to the blockers list... |
The RT System itself - Status changed from 'new' to 'open' |
From @bulk88On Tue Apr 01 01:12:48 2014, shay wrote:
Some more testing. Removal of parens on EXPECT. VC6 C:\perl519\src\cpan\Encode\Unicode>cl usage: cl [ option... ] filename... [ /link linkoption... ] C:\perl519\src\cpan\Encode\Unicode>type uni3.c Move(source,dest,len,U8); C:\perl519\src\cpan\Encode\Unicode>cl -P uni3.c uni3.c C:\perl519\src\cpan\Encode\Unicode>type uni3.i ((void)( C:\perl519\src\cpan\Encode\Unicode> VC 2003 C:\perl519\src\cpan\Encode\Unicode>cl usage: cl [ option... ] filename... [ /link linkoption... ] C:\perl519\src\cpan\Encode\Unicode>type uni3.c Move(source,dest,len,U8); C:\perl519\src\cpan\Encode\Unicode>cl -P uni3.c uni3.c C:\perl519\src\cpan\Encode\Unicode>type uni3.i ((void)(((sizeof(U8) > 1 && ((MEM_SIZE)(len)+0.0) > MEM_SIZE_MAX/sizeof(U8)) ? ( C:\perl519\src\cpan\Encode\Unicode> Distilled even more C:\perl519\src\cpan\Encode\Unicode>cl usage: cl [ option... ] filename... [ /link linkoption... ] C:\perl519\src\cpan\Encode\Unicode>type uni3.c MEM_WRAP_CHECK(len, U8); C:\perl519\src\cpan\Encode\Unicode>cl -P uni3.c uni3.c C:\perl519\src\cpan\Encode\Unicode>type uni3.c MEM_WRAP_CHECK(len, U8); C:\perl519\src\cpan\Encode\Unicode>cl -P uni3.c uni3.c C:\perl519\src\cpan\Encode\Unicode>type uni3.i (sizeof(U8FFFF); C:\perl519\src\cpan\Encode\Unicode> Notice the missing ) and missing space after "U8" in the expansion. Removing/commenting out cBOOL stops the error. -- |
From @bulk88The swallowed )s can be fixed by adding more )s. (you could also remove the #define U8 U8, but that isn't interesting to explore since I documented it in the OP) C:\perl519\src\cpan\Encode\Unicode>cl usage: cl [ option... ] filename... [ /link linkoption... ] C:\perl519\src\cpan\Encode\Unicode>type uni3.c MEM_WRAP_CHECK(len, U8); C:\perl519\src\cpan\Encode\Unicode>cl -P uni3.c uni3.c C:\perl519\src\cpan\Encode\Unicode>type uni3.i (sizeof(U8) FFFF); C:\perl519\src\cpan\Encode\Unicode> C:\perl519\src\cpan\Encode\Unicode>cl usage: cl [ option... ] filename... [ /link linkoption... ] C:\perl519\src\cpan\Encode\Unicode>type uni3.c MEM_WRAP_CHECK(len, U8); C:\perl519\src\cpan\Encode\Unicode>cl -P uni3.c uni3.c C:\perl519\src\cpan\Encode\Unicode>type uni3.i (sizeof(U8))) FFFF); C:\perl519\src\cpan\Encode\Unicode> -- |
From @steve-m-hay(For the record, further discussion has appeared on p5p, including a working solution given here: http://www.nntp.perl.org/group/perl.perl5.porters/2014/04/msg214289.html) |
From [Unknown Contact. See original ticket](For the record, further discussion has appeared on p5p, including a working solution given here: http://www.nntp.perl.org/group/perl.perl5.porters/2014/04/msg214289.html) |
From @steve-m-hayNow fixed in blead by commit 080a704 using Dan's modified version of Daniel's patch. Thanks to both (and to Jan for reporting it). |
@steve-m-hay - Status changed from 'open' to 'resolved' |
From @iabynOn Mon, Apr 28, 2014 at 10:20:52AM -0700, Steve Hay via RT wrote:
Unfortunately that's broken g++ builds. Encode/encode.h contains: #ifdef U8 extern int do_encode(const encpage_t *enc, const U8 *src, STRLEN *slen, extern void Encode_DefineEncoding(encode_t *enc); #endif /* U8 */ and U8 is apparently no longer defined(?), so do_encode() isn't getting g++ -c -I./Encode -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -ggdb -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -DVERSION=\"2.57\" -DXS_VERSION=\"2.57\" -fPIC "-I../.." Encode.c I have no idea what the correct fix is. -- |
From @janduboisI'm not in a position to test this right now, but from looking at the * The encode.h header is included by other C apps in the distribution, * At some point core Perl no longer used a #define for U8, but a I think the proper fix would be to use e.g. the PERL_H symbol instead Cheers, On Mon, Apr 28, 2014 at 4:03 PM, Dave Mitchell <davem@iabyn.com> wrote:
|
From @steve-m-hayApologies for the g++ breakage. Compiling as C++ on Windows isn't easy Anyway, if I understand Jan's comments correctly the proposal is to try this: Inline Patchdiff --git a/cpan/Encode/Encode/encode.h b/cpan/Encode/Encode/encode.h
index af34ba2..52f54f7 100644
--- a/cpan/Encode/Encode/encode.h
+++ b/cpan/Encode/Encode/encode.h
@@ -1,7 +1,7 @@
#ifndef ENCODE_H
#define ENCODE_H
-#if !defined(U8) && !defined(U8TYPE)
+#ifndef PERL_H
/*
A tad devious this:
perl normally has a #define for U8 - if that isn't present then we
[1] Blimey! It was a year and a half ago already!: On 29 April 2014 00:46, Jan Dubois <jand@activestate.com> wrote:
|
From @iabynOn Tue, Apr 29, 2014 at 08:22:22AM +0100, Steve Hay wrote:
I'm afraid not. I've pushed what I think is the correct fix as -- |
From @craigberryOn Tue, Apr 29, 2014 at 2:22 AM, Steve Hay <steve.m.hay@googlemail.com> wrote:
Nope, still gives: Encode.xs:131:29: error: 'do_encode' was not declared in this scope because do_encode is only declared when U8 is defined: #ifdef U8 extern int do_encode(const encpage_t *enc, const U8 *src, STRLEN *slen, extern void Encode_DefineEncoding(encode_t *enc); #endif /* U8 */ Declaring U8 as a typedef will never make it be defined as a macro. I have not been following this ticket and could not make heads or |
From @steve-m-hayOn 29 April 2014 12:59, Dave Mitchell <davem@iabyn.com> wrote:
Thanks. That's still all good with VC6. I'll update cpan #95130 to |
From @bulk88On Tue Apr 29 00:22:48 2014, shay wrote:
Core interp compiles on VC 2003 C++. Lots of breakage in /cpan though, so I've never pursued it. There is also https://rt-archive.perl.org/perl5/Ticket/Display.html?id=120544 . -- |
Migrated from rt.perl.org#121554 (status was 'resolved')
Searchable as RT121554$
The text was updated successfully, but these errors were encountered: