[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] xen: use a dummy file in C99 header check



commit e9a5d40a20ec598736570db774d87cd9166d5245
Author:     Wei Liu <wei.liu2@xxxxxxxxxx>
AuthorDate: Thu Apr 6 19:33:36 2017 +0100
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Fri Apr 7 09:47:19 2017 +0100

    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.
    
    Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/include/Makefile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/include/Makefile b/xen/include/Makefile
index 65a732a..cd271dd 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -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 $@
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.