Issue 353 in include-what-you-use: fatal error: 'stdarg.h' file not found

570 views
Skip to first unread message

notifi...@include-what-you-use.org

unread,
Aug 12, 2016, 8:44:02 PM8/12/16
to include-wh...@googlegroups.com
New issue 353 by EFanZh: fatal error: 'stdarg.h' file not found
https://github.com/include-what-you-use/include-what-you-use/issues/353

I got an error when checking this file:

```c++
#include <iostream>

int main()
{
std::cout << "Hi!\n";
}
```

My include-what-you-use is installed in /usr/bin. The command line I use is:

include-what-you-use a.cpp

The output is:

```
In file included from a.cpp:1:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../include/c++/6.1.1/iostream:39:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../include/c++/6.1.1/ostream:38:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../include/c++/6.1.1/ios:38:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../include/c++/6.1.1/iosfwd:40:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../include/c++/6.1.1/bits/postypes.h:40:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../include/c++/6.1.1/cwchar:44:
/usr/include/wchar.h:39:11: fatal error: 'stdarg.h' file not found
# include <stdarg.h>
^

a.cpp should add these lines:

a.cpp should remove these lines:
- #include <iostream> // lines 1-1

The full include-list for a.cpp:
---
```

According to [README.md](https://github.com/include-what-you-use/include-what-you-use/blob/master/README.md), my clang is installed in /usr/bin, so there should be a stdarg.h in /usr/lib/clang/3.8.1/include, and I checked, there is a stdarg.h in that directory. So what is wrong?

Environment:

- OS: Arch Linux x86_x64
- clang: 3.8.1
- gcc: 6.1.1
- include-what-you-use (from [AUR](https://aur.archlinux.org/packages/include-what-you-use/)): 0.6

notifi...@include-what-you-use.org

unread,
Aug 13, 2016, 3:33:49 AM8/13/16
to include-wh...@googlegroups.com
Comment #0 on issue 353 by kimgr: fatal error: 'stdarg.h' file not found
https://github.com/include-what-you-use/include-what-you-use/issues/353

That is surprising. Can you run IWYU like this to get more info on the effective search paths?

$ include-what-you-use -v -Xiwyu -v6 a.cpp

The only thing I can think of that might be the problem is that IWYU 0.6 might've been built against clang 3.8.0, not 3.8.1, but I'm not sure. The command above should dump the relevant version too.

notifi...@include-what-you-use.org

unread,
Aug 14, 2016, 8:47:38 PM8/14/16
to include-wh...@googlegroups.com
Comment #2 on issue 353 by EFanZh: fatal error: 'stdarg.h' file not found
https://github.com/include-what-you-use/include-what-you-use/issues/353

You are right, my IWYU is built against clang 3.8.0. After a system upgrade, my clang is upgraded but I did not rebuild the IWYU, hence the problem. After rebuilding IWYU, everything seems fine now, thanks. You can close this issue now.

notifi...@include-what-you-use.org

unread,
Aug 15, 2016, 1:51:01 AM8/15/16
to include-wh...@googlegroups.com

notifi...@include-what-you-use.org

unread,
Aug 15, 2016, 3:02:06 PM8/15/16
to include-wh...@googlegroups.com
Comment #3 on issue 353 by kimgr: fatal error: 'stdarg.h' file not found
https://github.com/include-what-you-use/include-what-you-use/issues/353

OK, thanks!

Reply all
Reply to author
Forward
0 new messages