abi-compliance-checker icon indicating copy to clipboard operation
abi-compliance-checker copied to clipboard

TUDump.pm:preChange: regular expression doesn't match expressions it should per description

Open jnpkrn opened this issue 7 years ago • 1 comments

666         $Regex = qr/(\A|\n[^\#\/\n][^\n]*?|\n)(\*\s*|\s+|\@|\,|\()($RegExp_C|$RegExp_F)(\s*([\,\)\;\.\[]|\-\>|\:\s*\d))/;
667         while($Content=~/$Regex/)
668         { # MATCH:
669           # int foo(int new, int class, int (*new)(int));
670           # int foo(char template[], char*);
671           # unsigned private: 8;
672           # DO NOT MATCH:
673           # #pragma GCC visibility push(default)

However, when I try to do

if("int foo(int new, int class, int (*new)(int))"=~/$Regex/) {
  printMsg("ERROR", "Matches");
}

I can conclude the intended case is missed as the error is not shown.

jnpkrn avatar Jan 05 '18 10:01 jnpkrn

Hmm, I was pasting the above example at the wrong location where it wasn't ever executed, which I -- not knowing what last means -- wasn't expecting...

Anyway, see #70 for a solution that would make my use case work again, however I cannot estimate the risk of accidentally breaking something else.

This is more a question of having existing code respond to known issues, I am going to give abi-dumper a try and presumably will switch to it fully.

jnpkrn avatar Jan 08 '18 21:01 jnpkrn