develooper Front page | perl.perl5.porters | Postings from October 2014

[perl #122966] [PATCH] bogus fatal warnings can hide syntax errors

Thread Previous | Thread Next
From: via RT
October 13, 2014 20:26
[perl #122966] [PATCH] bogus fatal warnings can hide syntax errors
Message ID:
On Mon Oct 13 06:12:04 2014, sprout wrote:
> Since the programmer has requested fatal warnings, why not send it to
> qerror instead of simply turning off the fatality?

Because I wasn't aware qerror() exists. :-)

This works:

    if (PL_warnhook == PERL_WARNHOOK_FATAL || ckDEAD(err)) {
        SV * const msv = vmess(pat, args);

        if (PL_parser && PL_parser->error_count) {
        else {
            invoke_exception_hook(msv, FALSE);
    else {
        Perl_vwarn(aTHX_ pat, args);

but it changes the order of the output to:

syntax error at line 5, near "1 {"
"my" variable $wtf masks earlier declaration in same statement at line 7.
syntax error at line 8, near "}"
Execution of aborted due to compilation errors.

Personally I think this is an improvement (messages are ordered by line number) but it's different from non-fatal warnings now.

(Revised patch attached.)

via perlbug:  queue: perl5 status: open

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About