Skip Menu |

This queue is for tickets about the Syntax-Keyword-Try CPAN distribution.

Report information
The Basics
Id: 119665
Status: resolved
Priority: 0/
Queue: Syntax-Keyword-Try

People
Owner: Nobody in particular
Requestors: ZHENYZ [...] cpan.org
Cc:
AdminCc:

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



Subject: C90 compatibility
We are using some older version of MSVC. It would be great if you can restore C90-compatibility in Syntax/Keyword/Try.xs. If you think it fine I can create a patch for you.
On Tue Jan 03 03:42:20 2017, ZHENYZ wrote: Show quoted text
> We are using some older version of MSVC. It would be great if you can > restore C90-compatibility in Syntax/Keyword/Try.xs. If you think it > fine I can create a patch for you.
Sounds good. The trouble I usually have is trying to convince my compiler to only accept C90 things. If you can supply a patch I'll give that a poke. -- Paul Evans
Attached is the patch.
Subject: patch.diff
--- lib/Syntax/Keyword/Try.xs.orig 2017-01-05 22:04:29.244030075 +0800 +++ lib/Syntax/Keyword/Try.xs 2017-01-05 22:06:03.756994806 +0800 @@ -219,6 +219,8 @@ { OP *try = NULL, *catch = NULL; CV *finally = NULL; + OP *body = NULL, *ret = NULL; + I32 floor_ix, save_ix; lex_read_space(0); @@ -237,11 +239,11 @@ if(lex_consume("finally")) { lex_read_space(0); - I32 floor_ix = start_subparse(FALSE, CVf_ANON); + floor_ix = start_subparse(FALSE, CVf_ANON); SAVEFREESV(PL_compcv); - I32 save_ix = block_start(0); - OP *body = parse_block(0); + save_ix = block_start(0); + body = parse_block(0); SvREFCNT_inc(PL_compcv); body = block_end(save_ix, body); @@ -255,7 +257,7 @@ croak("Expected try {} to be followed by either catch {} or finally {}"); } - OP *ret = try; + ret = try; /* If there's a catch block, make * $RET = eval { $TRY; 1 } or do { $CATCH } @@ -306,10 +308,10 @@ static int my_keyword_plugin(pTHX_ char *kw, STRLEN kwlen, OP **op) { + HV *hints; if(PL_parser && PL_parser->error_count) return (*next_keyword_plugin)(aTHX_ kw, kwlen, op); - HV *hints; if(!(hints = GvHV(PL_hintgv))) return (*next_keyword_plugin)(aTHX_ kw, kwlen, op);
Thanks. Will be in 0.06 (I forgot to check here before I just released 0.05. Oops) -- Paul Evans
Fixed -- Paul Evans