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
Describe the bug
A clear and concise description of what the bug is.
Both clang and gcc support "--include " to include a header file when compiling a C files. It seems the right format should be either "--include=" or "--include" according to man page, but separated by space also works in practice. However, when separated by space, bear doesn't generate correct result database.
To Reproduce
Steps to reproduce the behavior:
Here are the test files:
~/Source/test$ cat foo.c
#ifdef BAR_AVAILABLE
int bar(int x) { return x + 5; }
#endif
int foo(int x) {
return bar(x) * 5;
}
:~/Source/test$ cat bar.h
#define BAR_AVAILABLE
#572 PR is suppose to fix this issue. (Although it is -include and not --include what we handle. But double checked the GCC manual, and it mentions the include with a single dash prefix.)
Describe the bug
A clear and concise description of what the bug is.
Both clang and gcc support "--include " to include a header file when compiling a C files. It seems the right format should be either "--include=" or "--include" according to man page, but separated by space also works in practice. However, when separated by space, bear doesn't generate correct result database.
To Reproduce
Steps to reproduce the behavior:
Here are the test files:
Running command
bear -- clang --includebar.h -c foo.c -o foo.o
orbear -- clang --include=bar.h -c foo.c -o foo.o
will generate expected database.However,
bear -- clang --include bar.h -c foo.c -o foo.o
will not:All three commands build fine when not using bear.
Expected behavior
I'd expect bear generates same, correct json file when using "--include " just like the other two ways.
Environment:
Additional context
I'm using both clang and gcc and the behavior is same. Here are the clang/gcc versions I'm using:
~/Source/test$ clang --version
Debian clang version 16.0.6 (19)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
~/Source/test$ gcc --version
gcc (Debian 13.2.0-10) 13.2.0
The text was updated successfully, but these errors were encountered: