You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The C sources that are being tested are parsed using clang. The problem is that the result of this parsing (AST) is not always the same on all the supported platforms (Linux, Windows, macOS). Difference can probably occur even between machines using the same platform. Even if the same version of clang is used, there can be differences. It looks like system includes play a role here. The problem is most prominent in call expression parsing, but probably can occur in other situations as well.
macOS does not parse the call at all - it completely ignores it.
macOS without the long list of includes parses it ok and recognizes sigaddset call.
macOS without the type cast (i.e. sigaddset(&set, SIGINT)) parses the call as __sigbits.
Another example is parsing of strlcpy() call (without proper type signature). Linux parses it ok, but macOS does not. It parses it only if the function (and its calls) have the full signature of
Can we force clang to use some custom set of includes that would be the same everywhere?
Can we remove the #include statements from C sources before parsing it? (=> I don't think so, without them, some other function calls may not get parsed.)
Are includes the only problem?
The text was updated successfully, but these errors were encountered:
PeterMatula
added a commit
to avast/retdec-regression-tests
that referenced
this issue
Aug 23, 2018
In all the disabled cases functions Y are actually called on macOS, but the regression test framework does not parse the output C correctly and does not know about the calls. See this for more details: avast/retdec-regression-tests-framework#8
The C sources that are being tested are parsed using clang. The problem is that the result of this parsing (AST) is not always the same on all the supported platforms (Linux, Windows, macOS). Difference can probably occur even between machines using the same platform. Even if the same version of clang is used, there can be differences. It looks like system includes play a role here. The problem is most prominent in call expression parsing, but probably can occur in other situations as well.
Example:
sigaddset
call.sigaddset
call.sigaddset(&set, SIGINT)
) parses the call as__sigbits
.Another example is parsing of
strlcpy()
call (without proper type signature). Linux parses it ok, but macOS does not. It parses it only if the function (and its calls) have the full signature ofSolutions:
#include
statements from C sources before parsing it? (=> I don't think so, without them, some other function calls may not get parsed.)The text was updated successfully, but these errors were encountered: