Bug 8228 - Stricter syntax warning in Perl 5.39
Summary: Stricter syntax warning in Perl 5.39
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Building & Packaging (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: All All
: P2 normal
Target Milestone: 4.0.1
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-11 23:12 UTC by Sidney Markowitz
Modified: 2024-03-11 23:39 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Sidney Markowitz 2024-03-11 23:12:59 UTC
Perl 5.39 has a new stricter check for code that may be misleading due to obscure precedence of operators. See https://perldoc.perl.org/blead/perl5396delta
and the errors in spamassassin.raw line 293
https://www.cpantesters.org/cpan/report/017fa1c0-dff2-11ee-8d78-4d126e8775ea

This just needs to be parenthesized to eliminate the warning.
Comment 1 Sidney Markowitz 2024-03-11 23:19:18 UTC
Actually, now that I'm reading it over, it looks like the warning has found a longstanding bug. The documentation I linked to uses as an example exactly what is being warned here. It says

exit $x ? 0 : 1;  # actually parses as: exit($x) ? 0 : 1;

spamassassin.raw line 293 is

exit $res ? 1 : 0;

We intend exit($res ? 1 : 0);
not exit($res) ? 1 : 0;

right?
Comment 2 Sidney Markowitz 2024-03-11 23:39:11 UTC
% svn ci -m "8228 fix operator precedence error caught by perl 5.39 warning" spamassassin.raw 
Sending        spamassassin.raw
Transmitting file data .done
Committing transaction...
Committed revision 1916242.