Reproducer:
$ printf "#include <stdio.h>" > a.c
$ nix-shell -p include-what-you-use
$$ include-what-you-use -c a.c
a.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^~~~~~~~~
The problem here happens because include-what-you-use failed to embed system headers:
$ strace -f include-what-you-use -c a.c |& fgrep /include
newfstatat(AT_FDCWD, "/nix/store/i7dkz0zjzv4aiyc5zldsgj23mwn14kf8-include-what-you-use-0.18/lib/clang/14.0.6/include", 0x7ffcc0b326d0, 0) = -1 ENOENT (No such file or directory)
Reproducer:
The problem here happens because
include-what-you-usefailed to embed system headers: