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
# clang++ -I b -I c -c test.cpp -otest
In file included from test.cpp:1:
In file included from ./a/a.h:1:
In file included from b/b.h:1:
c/c.h:1:1: error: unknown type name 'hello_c'
hello_c c;
^
1 error generated.
# g++ -I b -I c -c test.cpp -otest
In file included from b/b.h:1:0,
from a/a.h:1,
from test.cpp:1:
c/c.h:1:1: error: ‘hello_c’ does not name a type
hello_c c;
^~~~~~~
however, when use codeql extractor by /usr/local/bin/codeql/cpp/tools/linux64/extractor --mimic clang++ -I b -I c -c test.cpp -otest, it shows
"a/c.h", line 1: error: identifier "hi_c" is undefined
hi_c c;
^
[E 09:26:49145792] Warning[extractor-c++]: In construct_text_message: "a/c.h", line 1: error: identifier "hi_c" is undefined
hi_c c;
^
It includes a/c.h, which is the same with MSVC, but gcc/clang includes c/c.h.
Clang and GCC using a static context for search directory, but MSVC use a dynamic context, which caused the problem.
I wanna CodeQL extractor to support the behavior of Clang and GCC for more consistent result with the clang compiled ELF.
The text was updated successfully, but these errors were encountered:
qwerty472123
changed the title
support the search order of header files used by clang/gcc
C++: support the search order of header files used by clang/gcc
Jun 3, 2024
As a example:
however, when use codeql extractor by
/usr/local/bin/codeql/cpp/tools/linux64/extractor --mimic clang++ -I b -I c -c test.cpp -otest
, it showsIt includes a/c.h, which is the same with MSVC, but gcc/clang includes c/c.h.
Clang and GCC using a static context for search directory, but MSVC use a dynamic context, which caused the problem.
I wanna CodeQL extractor to support the behavior of Clang and GCC for more consistent result with the clang compiled ELF.
The text was updated successfully, but these errors were encountered: