Regions passed to pthread* functions are invalidated in tests because the call is evaluated conservatively and declarations are not located in system header. This patch creates a system-like header with declarations previously located in test file.
This feels like a big hammer to wield just to prevent the conservative invalidation done by the static analyzer for calls to functions whose bodies are not available.
I feel like a more general approach might be to provide new hooks for checkers to provide hints to the core analyzer engine. For example, a callback that indicates whether or not invalidation should take place. That seems like a solution that could be utilized by other checkers besides just this one, and would allow checkers to opt into this with very little code.
I tend to agree. eval::Call has the downside that only one checker can provide an implementation (since it controls the return value). But I'm also surprised that the example is failing—because the pthread_* methods are declared in system headers, only globals declared in system headers should be invalidated.