]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen: use a dummy file in C99 header check
authorWei Liu <wei.liu2@citrix.com>
Thu, 6 Apr 2017 18:33:36 +0000 (19:33 +0100)
committerWei Liu <wei.liu2@citrix.com>
Fri, 7 Apr 2017 08:47:19 +0000 (09:47 +0100)
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>
xen/include/Makefile

index 65a732a70733353b6b7fc56cf45828b9f5b0f61b..cd271dde0a730c0bee8dd00360caa0f72a2fb159 100644 (file)
@@ -111,9 +111,10 @@ headers.chk: $(PUBLIC_ANSI_HEADERS) Makefile
 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 $@