lvc / abi-compliance-checker

A tool for checking backward API/ABI compatibility of a C/C++ library
https://lvc.github.io/abi-compliance-checker/
GNU Lesser General Public License v2.1
622 stars 76 forks source link

Ambiguous regex in Internals/SysFiles.pm to detect "failing" GCC-version #76

Closed ibiatiroler closed 6 years ago

ibiatiroler commented 6 years ago

Hi!

It seems, that regex-compare in modules/Internals/SysFiles.pm nearby line 763 if($GccVer=~/\A4\.8(|\.[012])|6\..*|7(\..*)?\Z/) or as released in 2.2 if($GccVer=~/\A4\.8(|\.[012])|6\..*|7\..*\Z/) is "ambiguous"; I.e., also matches the GCC-version 4.6.4 (in my case).

Using an addition grouping around "4.8(|.[012])|6..|7(..)?" has fixed the "miss-detection" of string-start and -end.

In my case, changing this line to (IMHO, my variant to detect 4.8[.0-2] and >= 6.x) if($GccVer=~/\A(4\.8(\.[012])?|[6-9]\..*)\Z/) has fixed this issue.

Best regards, Markus

ibiatiroler commented 6 years ago

Sorry!

Still fixed by commit https://github.com/lvc/abi-compliance-checker/commit/bcc9a7679a772135260cf1921e6c7fe7fc10d3c2