The check builds header file as if it is a C file. Clang doesn't like
the idea of having dead code in C file. The check as-is fails on Clang
with unused function warnings.
Use a dummy file like the C++ header check to fix this.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
headers99.chk: $(PUBLIC_C99_HEADERS) Makefile
rm -f $@.new
$(foreach i, $(filter %.h,$^), \
- $(CC) -x c -std=c99 -Wall -Werror \
- -include stdint.h $(foreach j, $($(i)-prereq), -include $(j).h) \
- -S -o /dev/null $(i) \
+ echo "#include "\"$(i)\" \
+ | $(CC) -x c -std=c99 -Wall -Werror \
+ -include stdint.h $(foreach j, $($(i)-prereq), -include $(j).h) \
+ -S -o /dev/null - \
|| exit $$?; echo $(i) >> $@.new;)
mv $@.new $@