nimble-code / Cobra

An interactive (fast) static source code analyzer
139 stars 31 forks source link

Warnings don't go to stderr #14

Closed pigsinablanket closed 3 years ago

pigsinablanket commented 3 years ago

I get a warning for a pattern expression that goes to stdout which causes issues with parsing

$ cobra -json -pe "{ .* memset ( ^)* x:@ident , ^)* , ^)* ) ^:x* free ( ^):x ) .* }" a.c
warning: is a space missing before : in '):x'?

This specific warning is also a false positive.

nimble-code commented 3 years ago

hi - the warning is actually accurate -- the final ^):x fragment in the expression should be written ^) :x or else the parser will try to look for anything other (the ^) than the single three-letter token ):x but, yes, it should go to stderr -- will fix that. (also working on fixes for the other two issues -- will have that ready soon)

nimble-code commented 3 years ago

actually, the warning is already going to stderr (line 1902 in the current cobra_te.c on github)

pigsinablanket commented 3 years ago

Thank you for the clarification for the warning.

It looks like it was changed very recently and I hadn't pulled down the latest changes.