October 2018 Archives

Check of the Perl 5 interpreter using a static analyzer

Developers team of the PVS-Studio static code analyzer for C/C++/C#/Java checked the Perl 5 source code and found some errors.

For example, the incorrect using of the ternary operator:

V502 Perhaps the '?:' operator works in a different way than it was expected. The '?:' operator has a lower priority than the '-' operator. toke.c 9494

if (s <= PL_bufend - (is_utf8) ? UTF8SKIP(s) : 1)

All examples are available in the article: Perl 5: How to Hide Errors in Macros.

About Svyatoslav Razmyslov

user-pic I blog about Perl.