From nobody Mon Feb 9 20:36:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 16962321399041001.52113541053; Mon, 2 Oct 2023 00:35:39 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.611117.950533 (Exim 4.92) (envelope-from ) id 1qnDSS-0001QP-HM; Mon, 02 Oct 2023 07:35:12 +0000 Received: by outflank-mailman (output) from mailman id 611117.950533; Mon, 02 Oct 2023 07:35:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qnDSS-0001QH-E7; Mon, 02 Oct 2023 07:35:12 +0000 Received: by outflank-mailman (input) for mailman id 611117; Mon, 02 Oct 2023 07:35:10 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qnDSQ-0000vL-U3 for xen-devel@lists.xenproject.org; Mon, 02 Oct 2023 07:35:10 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 35fe485f-60f6-11ee-9b0d-b553b5be7939; Mon, 02 Oct 2023 09:35:08 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id AEA9F4EE073E; Mon, 2 Oct 2023 09:35:07 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 35fe485f-60f6-11ee-9b0d-b553b5be7939 From: Nicola Vetrini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Nicola Vetrini , Wei Liu , Anthony PERARD , George Dunlap , Julien Grall , Henry Wang Subject: [XEN PATCH v3 2/3] docs: make the docs for MISRA C:2012 Dir 4.1 visible to ECLAIR Date: Mon, 2 Oct 2023 09:34:49 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1696232141186100001 Content-Type: text/plain; charset="utf-8" To be able to check for the existence of the necessary subsections in the documentation for MISRA C:2012 Dir 4.1, ECLAIR needs to have a source file that is built. This file is generated from 'C-runtime-failures.rst' in docs/misra and the configuration is updated accordingly. Signed-off-by: Nicola Vetrini Acked-by: Stefano Stabellini --- Changes from RFC: - Dropped unused/useless code - Revised the sed command - Revised the clean target Changes in v2: - Added explanative comment to the makefile - printf instead of echo Changes in v3: - Terminate the generated file with a newline - Build it with -std=3Dc99, so that the documentation for D1.1 applies. --- docs/Makefile | 7 ++++++- docs/misra/Makefile | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 docs/misra/Makefile diff --git a/docs/Makefile b/docs/Makefile index 966a104490ac..ff991a0c3ca2 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -43,7 +43,7 @@ DOC_PDF :=3D $(patsubst %.pandoc,pdf/%.pdf,$(PANDOCSRC-y= )) \ all: build =20 .PHONY: build -build: html txt pdf man-pages figs +build: html txt pdf man-pages figs misra =20 .PHONY: sphinx-html sphinx-html: @@ -66,9 +66,14 @@ endif .PHONY: pdf pdf: $(DOC_PDF) =20 +.PHONY: misra +misra: + $(MAKE) -C misra + .PHONY: clean clean: clean-man-pages $(MAKE) -C figs clean + $(MAKE) -C misra clean rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~ rm -rf *.ilg *.log *.ind *.toc *.bak *.tmp core rm -rf html txt pdf sphinx/html diff --git a/docs/misra/Makefile b/docs/misra/Makefile new file mode 100644 index 000000000000..949458ff9e15 --- /dev/null +++ b/docs/misra/Makefile @@ -0,0 +1,22 @@ +TARGETS :=3D C-runtime-failures.o + +all: $(TARGETS) + +# This Makefile will generate the object files indicated in TARGETS by tak= ing +# the corresponding .rst file, converting its content to a C block comment= and +# then compiling the resulting .c file. This is needed for the file's cont= ent to +# be available when performing static analysis with ECLAIR on the project. + +# sed is used in place of cat to prevent occurrences of '*/' +# in the .rst from breaking the compilation +$(TARGETS:.o=3D.c): %.c: %.rst + printf "/*\n\n" > $@.tmp + sed -e 's|\*/|*//*|g' $< >> $@.tmp + printf "\n\n*/\n" >> $@.tmp + mv $@.tmp $@ + +%.o: %.c + $(CC) -std=3Dc99 -c $< -o $@ + +clean: + rm -f C-runtime-failures.c *.o *.tmp --=20 2.34.1