Skip to contentSkip to conversation

xen: use a dummy file in C99 header check

PATCH In review Wei Liu 2 participants 2 messages Apr 6, 2017

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 xen: use a dummy file in C99 header check

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.

---
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Wei Liu <[email protected]>

---
 xen/include/Makefile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
xen/include/Makefile +4 -3
index 65a732a707..cd271dde0a 100644
@@ -111,9 +111,10 @@ headers.chk: $(PUBLIC_ANSI_HEADERS) Makefile
 headers99.chk: $(PUBLIC_C99_HEADERS) Makefile
 	rm -f [email protected]
 	$(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) >> [email protected];)
 	mv [email protected] $@
 
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Wei Liu

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.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel