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
* Can you explain your question around macro expansion? SARIF defines a `originalUriBaseId` property for defining absolute paths for non-deterministic source roots, which you're already populating. Would you like other macro/var definitions to be expressed in the format?
...when I spoke of macro expansion, I was referring to languages with a preprocessor, such as C/C++, where the question of "where in the source-code-under-analysis are we?" can involve a nested series of macro expansions, potentially involving multiple files (e.g. use of a macro declared in one header, which refers to a macro in another header, etc).
Consider e.g.:
#include <stdlib.h>
#define FREE(X) free(X)
#define REALLY_FREE(X) FREE(X)
#define MAYBE_FREE(X,F) do { if (F) REALLY_FREE(X); } while (0)
void test (void *p, int flag)
{
MAYBE_FREE(p, flag);
MAYBE_FREE(p, flag);
}
I wonder if this could be expressed by adding a new "kind" within locationRelationship's 3.34.3 kinds property, similar to how that can capture a chain of #include?
Addressing one specific point:
...when I spoke of macro expansion, I was referring to languages with a preprocessor, such as C/C++, where the question of "where in the source-code-under-analysis are we?" can involve a nested series of macro expansions, potentially involving multiple files (e.g. use of a macro declared in one header, which refers to a macro in another header, etc).
Consider e.g.:
GCC output: https://godbolt.org/z/87vf1cGKK
where GCC's textual output can emit the chain of macro expansions:
There didn't seem to be a way to express this within SARIF. Is there one, or did I miss it? Thanks!
Originally posted by @davidmalcolm in #531 (comment)
The text was updated successfully, but these errors were encountered: