SA Bugzilla – Bug 8228
Stricter syntax warning in Perl 5.39
Last modified: 2024-03-11 23:39:11 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.
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?
% 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.