[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 16/17] xen/build: address violation of MISRA C Directive 4.10
This addresses violations of MISRA C:2012 Rule 4.10 which states as following: Precautions shall be taken in order to prevent the contents of a header file being included more than once. Added inclusion guards for autogenerated header files: include/xen/compile.h and include/xen/hypercall-defs.h. No functional change. Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@xxxxxxxxxxx> --- xen/build.mk | 6 +++++- xen/include/Makefile | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/xen/build.mk b/xen/build.mk index bbd4c2970f..c83882c949 100644 --- a/xen/build.mk +++ b/xen/build.mk @@ -18,6 +18,8 @@ quiet_cmd_compile.h = UPD $@ define cmd_compile.h if [ ! -r $@ -o -O $@ ]; then \ cat .banner; \ + echo '#ifndef INCLUDE_XEN_COMPILE_H' >> $(dot-target).tmp; \ + echo '#define INCLUDE_XEN_COMPILE_H' >> $(dot-target).tmp; \ sed -e 's/@@date@@/$(XEN_BUILD_DATE)/g' \ -e 's/@@time@@/$(XEN_BUILD_TIME)/g' \ -e 's/@@whoami@@/$(XEN_WHOAMI)/g' \ @@ -28,8 +30,9 @@ define cmd_compile.h -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \ -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \ -e 's!@@changeset@@!$(shell $(srctree)/tools/scmversion $(XEN_ROOT) || echo "unavailable")!g' \ - < $< > $(dot-target).tmp; \ + < $< >> $(dot-target).tmp; \ sed -rf $(srctree)/tools/process-banner.sed < .banner >> $(dot-target).tmp; \ + echo '#endif /* INCLUDE_XEN_COMPILE_H */' >> $(dot-target).tmp; \ mv -f $(dot-target).tmp $@; \ fi endef @@ -40,6 +43,7 @@ include/xen/compile.h: include/xen/compile.h.in .banner FORCE targets += include/xen/compile.h + -include $(wildcard .asm-offsets.s.d) asm-offsets.s: arch/$(SRCARCH)/$(ARCH)/asm-offsets.c $(CC) $(call cpp_flags,$(c_flags)) -S -g0 -o $@.new -MQ $@ $< diff --git a/xen/include/Makefile b/xen/include/Makefile index eccc2e017a..34e133949c 100644 --- a/xen/include/Makefile +++ b/xen/include/Makefile @@ -121,7 +121,10 @@ $(obj)/compat/xlat.h: $(addprefix $(obj)/compat/.xlat/,$(xlat-y)) FORCE quiet_cmd_genhyp = GEN $@ define cmd_genhyp - awk -f $(srctree)/scripts/gen_hypercall.awk <$< >$@ + echo "#ifndef XEN_HYPERCALL_DEFS_H" >$@; \ + echo "#define XEN_HYPERCALL_DEFS_H" >>$@; \ + awk -f $(srctree)/scripts/gen_hypercall.awk <$< >>$@; \ + echo "#endif /* XEN_HYPERCALL_DEFS_H */" >>$@ endef all: $(obj)/xen/hypercall-defs.h -- 2.34.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |