From nobody Tue Nov 5 14:40:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1586629978; cv=none; d=zohomail.com; s=zohoarc; b=M3LkubT+Z8jjg/JgqNKyTnQpMx1nWSsjJt8VFSR9wRy3caKIypO+fdTRs/kNipfpUxhN28tHJNXD4zmD4dKQRZV3nY+LftwzkmvuRc4jr60HeelVGnH3n+aOben9LetUiz3IlhTjBtKJGX2Jd0wOUu8BG/bdtu+DJxM2h8lMxJA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586629978; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=K3xopzk9ZlZX+c2ieZ27XJmBTBZ8Z8Hb6pkp8KbVxfo=; b=bRxoH8KZL4VaP6rx7mWF5wrIZq+Te4aevkJcet3E3N2RpDWnsHg+fA41jIuAgORFo2/+B33iM48xzCIUBPdkeGV5BgOCwbboSSVFhxQYAguebiaL9Ecl4t5mbNe9pWs5WanMMBlfUBKH2qA7OnhNip79FKIPblegVH1AMxErzvQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586629978650693.3000954265857; Sat, 11 Apr 2020 11:32:58 -0700 (PDT) Received: from localhost ([::1]:54656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNKw5-0008Ll-C7 for importer@patchew.org; Sat, 11 Apr 2020 14:32:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34743) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNKst-00064u-Qs for qemu-devel@nongnu.org; Sat, 11 Apr 2020 14:29:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNKss-0003O5-L9 for qemu-devel@nongnu.org; Sat, 11 Apr 2020 14:29:39 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:36985) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jNKss-0003NM-FT for qemu-devel@nongnu.org; Sat, 11 Apr 2020 14:29:38 -0400 Received: by mail-wr1-x430.google.com with SMTP id w10so5803296wrm.4 for ; Sat, 11 Apr 2020 11:29:38 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 68sm8910939wrm.65.2020.04.11.11.29.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Apr 2020 11:29:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K3xopzk9ZlZX+c2ieZ27XJmBTBZ8Z8Hb6pkp8KbVxfo=; b=tM3tqWQtJRDv2IXwsoJYlHcQ+FpbV4uKwGDcux9RYRzQt3b9x2Ff8CwuvHsi14p/t3 vfjqZXUl9WdGMhtgycXJ/6hwuHZQzoqRcR8/eHXo1mQP5dRcPNwB3W/BtaoYfSBQ6N9e 6LLQUHh97L6QI7kNcLX2sYItUmnALrcEjoF21+GuoIE6nkk/WltzPK3DjYAtm2v5rNL7 8tl1NneRbFFA5BevQoujKS1CLdB09YhQE7YPuCPHecK0GpmokmG4ICyGe0V6x+oaWrOX NYVvLm6fDiJy1Wv+802tw2kqEuXUOTE9SI3UmuHCPQxySAsYr5eIA1pITdVAmp9RdEPD mktw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=K3xopzk9ZlZX+c2ieZ27XJmBTBZ8Z8Hb6pkp8KbVxfo=; b=nVZUhecpEMoESfvAzGQfense7n+fOw7Bd1ND3uYY2wm8wmS+fN7QKQY3y319tbMstW +904ZsJB3FRMJ3nKJyqus5igIa9W9V1TqA36VQLtLWfTV5ZPCoD2g+mKGVbeemC3ffvD ukqvQFuX91moyrYR45q6mJfNCFXyRT720kwnKBH+//4dS2HvWO+g8N8cRytySCdsVv5C iFp3+iNUW4jS5nTjsZ+tpqIg1lMDbvQlfcQfoXa0Ye8uvggf49Rw0ka455Q2txnhq4zU LaY1sOVgJg5CRBKMDamu9IchwB+8yroMLbHxnuGeDdl0NvZLynuCTVFUI4z5XCzgdPKZ BRsw== X-Gm-Message-State: AGi0PuYzYKpV0q3hhd770qnI4FkDoWVyAwkDhEX9sV6kiF/QB4MvoayK zC+Txixz/3o7odibtCs9SMDcFHNKfyvf7A== X-Google-Smtp-Source: APiQypI/+SgKj1ASs4nHy0fMhJDyL49PvevSzN/SjUq5X/q5cZuRG0tB4oRuTjqAwmCSrtaz2HbsSw== X-Received: by 2002:adf:df82:: with SMTP id z2mr385664wrl.58.1586629777241; Sat, 11 Apr 2020 11:29:37 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH for-5.0? 1/3] configure: Honour --disable-werror for Sphinx Date: Sat, 11 Apr 2020 19:29:32 +0100 Message-Id: <20200411182934.28678-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200411182934.28678-1-peter.maydell@linaro.org> References: <20200411182934.28678-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::430 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" If we are not making warnings fatal for compilation, make them non-fatal when building the Sphinx documentation also. (For instance Sphinx 3.0 warns about some constructs that older versions were happy with, which is a build failure if we use the warnings-as-errors flag.) This provides a workaround at least for LP:1872113. Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- configure | 9 ++++++++- Makefile | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 22870f38672..7b9ae0418d0 100755 --- a/configure +++ b/configure @@ -4928,6 +4928,12 @@ if check_include sys/kcov.h ; then kcov=3Dyes fi =20 +# If we're making warnings fatal, apply this to Sphinx runs as well +sphinx_werror=3D"" +if test "$werror" =3D "yes"; then + sphinx_werror=3D"-W" +fi + # Check we have a new enough version of sphinx-build has_sphinx_build() { # This is a bit awkward but works: create a trivial document and @@ -4936,7 +4942,7 @@ has_sphinx_build() { # sphinx-build doesn't exist at all or if it is too old. mkdir -p "$TMPDIR1/sphinx" touch "$TMPDIR1/sphinx/index.rst" - "$sphinx_build" -c "$source_path/docs" -b html "$TMPDIR1/sphinx" "$TMP= DIR1/sphinx/out" >/dev/null 2>&1 + "$sphinx_build" $sphinx_werror -c "$source_path/docs" -b html "$TMPDIR= 1/sphinx" "$TMPDIR1/sphinx/out" >/dev/null 2>&1 } =20 # Check if tools are available to build documentation. @@ -7631,6 +7637,7 @@ echo "INSTALL_PROG=3D$install -c -m 0755" >> $config_= host_mak echo "INSTALL_LIB=3D$install -c -m 0644" >> $config_host_mak echo "PYTHON=3D$python" >> $config_host_mak echo "SPHINX_BUILD=3D$sphinx_build" >> $config_host_mak +echo "SPHINX_WERROR=3D$sphinx_werror" >> $config_host_mak echo "GENISOIMAGE=3D$genisoimage" >> $config_host_mak echo "CC=3D$cc" >> $config_host_mak if $iasl -h > /dev/null 2>&1; then diff --git a/Makefile b/Makefile index 84ef8816000..8a9113e6663 100644 --- a/Makefile +++ b/Makefile @@ -1076,7 +1076,7 @@ sphinxdocs: $(MANUAL_BUILDDIR)/devel/index.html \ # Note the use of different doctree for each (manual, builder) tuple; # this works around Sphinx not handling parallel invocation on # a single doctree: https://github.com/sphinx-doc/sphinx/issues/2946 -build-manual =3D $(call quiet-command,CONFDIR=3D"$(qemu_confdir)" $(SPHINX= _BUILD) $(if $(V),,-q) -W -b $2 -D version=3D$(VERSION) -D release=3D"$(FUL= L_VERSION)" -d .doctrees/$1-$2 $(SRC_PATH)/docs/$1 $(MANUAL_BUILDDIR)/$1 ,"= SPHINX","$(MANUAL_BUILDDIR)/$1") +build-manual =3D $(call quiet-command,CONFDIR=3D"$(qemu_confdir)" $(SPHINX= _BUILD) $(if $(V),,-q) $(SPHINX_WERROR) -b $2 -D version=3D$(VERSION) -D re= lease=3D"$(FULL_VERSION)" -d .doctrees/$1-$2 $(SRC_PATH)/docs/$1 $(MANUAL_B= UILDDIR)/$1 ,"SPHINX","$(MANUAL_BUILDDIR)/$1") # We assume all RST files in the manual's directory are used in it manual-deps =3D $(wildcard $(SRC_PATH)/docs/$1/*.rst $(SRC_PATH)/docs/$1/*= /*.rst) \ $(SRC_PATH)/docs/defs.rst.inc \ --=20 2.20.1 From nobody Tue Nov 5 14:40:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1586629856; cv=none; d=zohomail.com; s=zohoarc; b=Q+akW47oJW/SXJfRpbhhGQSh33kUcVo754GZyw+PGhQExRGga7KPSbJxWsWlJ293ptbN9OFYb4OqMjQJbz8HW1sZXyg3B/pJOjtXIEmMOrnPQs+3F47itY2JtNU+ULtXGvK3wziiObFnuXsIXBObI5WF0rtCVycGn6HXHkeXD98= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586629856; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cpLtHaTY+G/TD4kqalXzNVJElnY3acdoI1jKCfsmqWw=; b=iQOTtl/Pq1TW9AtWd5y/0qnGGS6ncAlny8u3sAL5QGQp8rzCE9h/tutu1HGmqyjo5cLcrWx4PGtGwLQmFfipjbt6q1mwTj0xZoQHxCZE3zz9SKX09ZfNP043JWs67hZ0zjcAyv+iMDlizVpWa0T/+3G5ZwZZ10cJ9h3IUvUykyY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586629856290214.6733158356866; Sat, 11 Apr 2020 11:30:56 -0700 (PDT) Received: from localhost ([::1]:54588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNKu6-0006vv-St for importer@patchew.org; Sat, 11 Apr 2020 14:30:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34759) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNKsu-00064v-Lt for qemu-devel@nongnu.org; Sat, 11 Apr 2020 14:29:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNKst-0003Of-Lv for qemu-devel@nongnu.org; Sat, 11 Apr 2020 14:29:40 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:33713) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jNKst-0003OE-Ft for qemu-devel@nongnu.org; Sat, 11 Apr 2020 14:29:39 -0400 Received: by mail-wm1-x342.google.com with SMTP id v8so7063717wma.0 for ; Sat, 11 Apr 2020 11:29:39 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 68sm8910939wrm.65.2020.04.11.11.29.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Apr 2020 11:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cpLtHaTY+G/TD4kqalXzNVJElnY3acdoI1jKCfsmqWw=; b=gISqeKjpJggBy2pSD4148Z7KxiSHHhXr06aemZPoK0c+IQ8N+uWAVFox3PBfOeAObf YH3IWXq28Vd8uQUuaW67Hjtf1K9ZDc8qgzYQ9rZ7K/JXhotmoP9xx/u8MuNaX62SdeXM 7I/9X52YHq8B3vBZmWWaTec91KwvC5Y+K9D8uq6Q+M980h/ONnHCha6va4fB9erj3n13 7vw7uhBvBTcG2fTIyDmYZ0g51E6gwRvGGQrzSG7fYSNRp9le2lWJ7Kwv+Hb0qUlfMZsF 6Z33JvpQyP51GjclL49LNAaknW38WvNIr1CJLDkLEhDeBoZp0w91ujx5He0+JDQmmN6u V/ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cpLtHaTY+G/TD4kqalXzNVJElnY3acdoI1jKCfsmqWw=; b=I4umPSCelNWD9aqhoE6qJOgwQOQFZt3csLLj24j5pKNA2kvFfRvwBdyfZkNbM3O23l KB6tlQ6gnWOpb3lRsLnQWc+ozZyXo6KuCMahNrC+Wvyd7g0FgdStipsa75KkiBXGUpL+ D+kthRXT4trrpxXO0zBc+qBEZ00UC9slIcr9i4BCoYZtSGz99ayKjs4wkq0RSCAe8Ai2 m+GKJrKkD0H2SsggkNzpunlUrDqr99wFSPZ9A+HUFQpQJzQPZ6xr0tw5cFdNdlNqjv1b OHRY4myI/HTJ6uX5T6zL4KLlaMssszHCPByX5NihbjlzRuuuwHavcxK6Yq7rW2j4X3be TduQ== X-Gm-Message-State: AGi0PuaFyZMsZibsYZNDZrTGH8eyq0+Pg7AsonA8vgdXSHgB5zymDox+ DQeJryIFW2sxcxMc6B10D88No1uDrhvyYw== X-Google-Smtp-Source: APiQypIiDRNqiGiMXXdgsMDqhRzJN4SqLGl21C7+eZnR1LusBqTFKdaqxrsKXLG214Fu6khcABDsiQ== X-Received: by 2002:a1c:35c3:: with SMTP id c186mr2014125wma.66.1586629778214; Sat, 11 Apr 2020 11:29:38 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH for-5.0? 2/3] scripts/kernel-doc: Add missing close-paren in c:function directives Date: Sat, 11 Apr 2020 19:29:33 +0100 Message-Id: <20200411182934.28678-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200411182934.28678-1-peter.maydell@linaro.org> References: <20200411182934.28678-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" When kernel-doc generates a 'c:function' directive for a function one of whose arguments is a function pointer, it fails to print the close-paren after the argument list of the function pointer argument, for instance: .. c:function:: void memory_region_init_resizeable_ram (MemoryRegion * mr= , struct Object * owner, const char * name, uint64_t size, uint64_t max_siz= e, void (*resized) (const char*, uint64_t length, void *host, Error ** errp) which should have a ')' after the 'void *host' which is the last argument to 'resized'. Older versions of Sphinx don't try to parse the argumnet to c:function, but Sphinx 3.0 does do this and will complain: /home/petmay01/linaro/qemu-from-laptop/qemu/docs/../include/exec/memory.h= :834: WARNING: Error in declarator or parameters Invalid C declaration: Expecting "," or ")" in parameters, got "EOF". [er= ror at 208] void memory_region_init_resizeable_ram (MemoryRegion * mr, struct Objec= t * owner, const char * name, uint64_t size, uint64_t max_size, void (*resi= zed) (const char*, uint64_t length, void *host, Error ** errp) -----------------------------------------------------------------------= ---------------------------------------------------------------------------= --------------------------------------------------------------^ Add the missing close-paren. Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson Tested-by: Alex Benn=C3=A9e --- scripts/kernel-doc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index af470eb3211..8dc30e01e58 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -853,7 +853,7 @@ sub output_function_rst(%) { =20 if ($type =3D~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { # pointer-to-function - print $1 . $parameter . ") (" . $2; + print $1 . $parameter . ") (" . $2 . ")"; } else { print $type . " " . $parameter; } --=20 2.20.1 From nobody Tue Nov 5 14:40:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1586630074; cv=none; d=zohomail.com; s=zohoarc; b=nsP/baZaA1Mj7DOrHNUmpL24C44XIuBFDVFbkX0Rv1m20ZJINyx0g0/5cJp3yVvTdK6wtH7QW8RnPkvJIQP83xPulFMrcf9Up0RHpAaNEP1pCQYUd7Y4TkAGmGzDVyjzrDeJxTdZUzzGb04oPo+kUXa1wdjDDNpBY3Q46tIRhig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586630074; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CRIV+Q39jqb8M8RfkaJ8QOUQyFaSY22+KDzJSczZeRM=; b=M8nwtns2k6oD8LYh+sTJvUfJBLX7hccDERkpgbfPVgdEjEIZ8rm8OoTlQcVZ8mvrKTDlQjMclI7I5/u7GlCOYqBPK+huxu8l7XRbgg1MnMs7FGeI74s5bhvMOORHuEJarvgSaAEauesQUmiIThPSmE4iEdFqIagYmizs1DBSOQQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586630074468430.1013737784365; Sat, 11 Apr 2020 11:34:34 -0700 (PDT) Received: from localhost ([::1]:54672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNKxd-00018Q-3Y for importer@patchew.org; Sat, 11 Apr 2020 14:34:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34770) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNKsv-000658-KU for qemu-devel@nongnu.org; Sat, 11 Apr 2020 14:29:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNKsu-0003PG-Hl for qemu-devel@nongnu.org; Sat, 11 Apr 2020 14:29:41 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:46602) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jNKsu-0003Oo-Br for qemu-devel@nongnu.org; Sat, 11 Apr 2020 14:29:40 -0400 Received: by mail-wr1-x444.google.com with SMTP id f13so5759904wrm.13 for ; Sat, 11 Apr 2020 11:29:40 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 68sm8910939wrm.65.2020.04.11.11.29.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Apr 2020 11:29:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CRIV+Q39jqb8M8RfkaJ8QOUQyFaSY22+KDzJSczZeRM=; b=lMys+IwJxhrC+8ZIvO+0LQ4mvYqexwpWYwlJYuD70iAq/cg7iCz2oJrQLZ9XSt6Nc5 31BY+UGiDujpQ2Chnp6YHtbNhgcZcEYU/5sBSDx44tnphuZPT6K+2RsZU9pDXJFQRg9G DD4RIxceu/bbqZF2AHFhSSOXZ8ydpY0vfN7oo0vfnrdW2ZcYKV14TPlMLnzWv7Jf0sAf 0cKBvhuMaWst74NHy2HLZCCoM/qK4GkMMal0kseTi5wYmKducwTMMBPfwviesB3a2687 dayjWZUe9FHCheCGTHntuCuFcPAYPnWnijIP8UaDBPRPmXbhBBsQPLDEMaRWHRpiMxlH Y6Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CRIV+Q39jqb8M8RfkaJ8QOUQyFaSY22+KDzJSczZeRM=; b=PO+8thH9R4hAcCsuYGZ7n54Qk506oGFpx1OvgAYW4udIr9bnwHZOaqUuBrAw1ucAPz t9+WVAwJJIogtFbWbBkZS2dICSXE0OIym9irXDbEdM2ypJTYzORhpIL2qqFlH2llqjXR pEtpwAyuLaQl7Wn64WrfkfeV2yDar9LnsFRWx51UZXRCYKR4+aMt9Kpy1N2H9QdbqiNQ sRQVlgFNddzDLc7bYwVpKnrLH6crYTDv3B+wxQItUnvuJRRPRQo3FmhpWlHgm29RuREH Nm3/nk7QNubA/er41MtmTcKbBandmAckt2qRj9npQO+Ymhyuj+pWrOm7MojOSNDZ14WM LmyA== X-Gm-Message-State: AGi0PuYteW706U085Y544uwl6/sSX5JexurLfyF07fs9H6fXOFPR43Xa pO13sQxGeil4Erj4p2DAM8fAo3zyIwj9IQ== X-Google-Smtp-Source: APiQypIGoQJMif1oQv2gaa57GdIrEaP9MnadTHStUMu7JLcCjiWU0bbd/d7llGjOP021bITS3yrZ1w== X-Received: by 2002:a05:6000:110a:: with SMTP id z10mr7458968wrw.389.1586629779066; Sat, 11 Apr 2020 11:29:39 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH for-5.0? 3/3] kernel-doc: Use c:struct for Sphinx 3.0 and later Date: Sat, 11 Apr 2020 19:29:34 +0100 Message-Id: <20200411182934.28678-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200411182934.28678-1-peter.maydell@linaro.org> References: <20200411182934.28678-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" The kernel-doc Sphinx plugin and associated script currently emit 'c:type' directives for "struct foo" documentation. Sphinx 3.0 warns about this: /home/petmay01/linaro/qemu-from-laptop/qemu/docs/../include/exec/memory.h= :3: WARNING: Type must be either just a name or a typedef-like declaration. If just a name: Error in declarator or parameters Invalid C declaration: Expected identifier in nested name, got keyword:= struct [error at 6] struct MemoryListener ------^ If typedef-like declaration: Error in declarator or parameters Invalid C declaration: Expected identifier in nested name. [error at 21] struct MemoryListener ---------------------^ because it wants us to use the new-in-3.0 'c:struct' instead. Plumb the Sphinx version through to the kernel-doc script and use it to select 'c:struct' for newer versions than 3.0. Fixes: LP:1872113 Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e --- docs/sphinx/kerneldoc.py | 1 + scripts/kernel-doc | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/sphinx/kerneldoc.py b/docs/sphinx/kerneldoc.py index 1159405cb92..3e879402064 100644 --- a/docs/sphinx/kerneldoc.py +++ b/docs/sphinx/kerneldoc.py @@ -99,6 +99,7 @@ class KernelDocDirective(Directive): env.note_dependency(os.path.abspath(f)) cmd +=3D ['-export-file', f] =20 + cmd +=3D ['-sphinx-version', sphinx.__version__] cmd +=3D [filename] =20 try: diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 8dc30e01e58..030b5c8691f 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -71,6 +71,8 @@ Output selection (mutually exclusive): DOC: sections. May be specified multiple times. =20 Output selection modifiers: + -sphinx-version VER Generate rST syntax for the specified Sphinx versi= on. + Only works with reStructuredTextFormat. -no-doc-sections Do not output DOC: sections. -enable-lineno Enable output of #define LINENO lines. Only works = with reStructuredText format. @@ -286,6 +288,7 @@ use constant { }; my $output_selection =3D OUTPUT_ALL; my $show_not_found =3D 0; # No longer used +my $sphinx_version =3D "0.0"; # if not specified, assume old =20 my @export_file_list; =20 @@ -436,6 +439,8 @@ while ($ARGV[0] =3D~ m/^--?(.*)/) { $enable_lineno =3D 1; } elsif ($cmd eq 'show-not-found') { $show_not_found =3D 1; # A no-op but don't fail + } elsif ($cmd eq 'sphinx-version') { + $sphinx_version =3D shift @ARGV; } else { # Unknown argument usage(); @@ -963,7 +968,16 @@ sub output_struct_rst(%) { my $oldprefix =3D $lineprefix; my $name =3D $args{'type'} . " " . $args{'struct'}; =20 - print "\n\n.. c:type:: " . $name . "\n\n"; + # Sphinx 3.0 and up will emit warnings for "c:type:: struct Foo". + # It wants to see "c:struct:: Foo" (and will add the word 'struct' in + # the rendered output). + if ((split(/\./, $sphinx_version))[0] >=3D 3) { + my $sname =3D $name; + $sname =3D~ s/^struct //; + print "\n\n.. c:struct:: " . $sname . "\n\n"; + } else { + print "\n\n.. c:type:: " . $name . "\n\n"; + } print_lineno($declaration_start_line); $lineprefix =3D " "; output_highlight_rst($args{'purpose'}); --=20 2.20.1