From patchwork Fri Apr 26 11:33:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13644680 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C8B59C4345F for ; Fri, 26 Apr 2024 11:34:14 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.712709.1113531 (Exim 4.92) (envelope-from ) id 1s0Jq8-0007dJ-RP; Fri, 26 Apr 2024 11:34:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 712709.1113531; Fri, 26 Apr 2024 11:34:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s0Jq8-0007dC-OP; Fri, 26 Apr 2024 11:34:04 +0000 Received: by outflank-mailman (input) for mailman id 712709; Fri, 26 Apr 2024 11:34:03 +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 1s0Jq7-0007b6-13 for xen-devel@lists.xenproject.org; Fri, 26 Apr 2024 11:34:03 +0000 Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [2607:f8b0:4864:20::22d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id e04f75f4-03c0-11ef-b4bb-af5377834399; Fri, 26 Apr 2024 13:34:01 +0200 (CEST) Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3c6f785208dso522829b6e.1 for ; Fri, 26 Apr 2024 04:34:01 -0700 (PDT) Received: from [10.80.67.140] (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id xb17-20020a05620a5ad100b0078edc0a447dsm7846019qkn.68.2024.04.26.04.33.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Apr 2024 04:33:58 -0700 (PDT) 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: e04f75f4-03c0-11ef-b4bb-af5377834399 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1714131239; x=1714736039; darn=lists.xenproject.org; h=content-transfer-encoding:autocrypt:subject:from:cc:to :content-language:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=v6mjIj93m9xz8b2aSM5XG/+E2T7xDy4nNpobywC1I5c=; b=Twu6z/JZu2a5SuhEq7ne+y1NP4RMxoAe+5oEiOf9SX52Tg/MwWeCvGz/vIZU7BDpcu mELPeD5aOAwbQaJA+AadT0T7Rop65mIZPN7kW/ICWOG8upfdmD81XS54CdnZ6q8EEUAM n9LVShoCPKACdeCLB1/acFZHwgnehqPazcyUU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714131239; x=1714736039; h=content-transfer-encoding:autocrypt:subject:from:cc:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=v6mjIj93m9xz8b2aSM5XG/+E2T7xDy4nNpobywC1I5c=; b=N4t/5jc/8L3tKujnq8gjirW0YyEnHzQqdGjzwU7GqhvCNldKgWlJaYOpWDW9phi00T u5fGx9tq/z4aJHvHxmV+LI+uTEBL8qj61nzviZTq1cBu3guu9tCQl/8bk0BNkOdsOIaD 837Py78qbUBJ7NX7zfr+ifIFptwBJpXgoyjufnu8m1tpMRkHUyC2dYPeNV9YmnU6TK81 dZw46S9EYOQItgrYnr+ymitRZ7dDUxGACwwl/9my2woDWNliCirS1UmeiULuHV6BHpvs uhzrT7ybT2nqBmksiEcR0Ibb1F+aPgi0Ot0Bo5ioUfFjBqpzAOYwD1sDdCT9Xt2MT44s elfQ== X-Gm-Message-State: AOJu0YxfY8N+0N8ChNfTZphuN5g1fC54HtBL/tZWFl77eI+XbEpr7xyt qiqTROc6Hja9Fj+qEhEGqJ+x0FDE5lA36RztvU5/1GWwWpKWhz6Nim4aU16tUefwxlbYC/JOzt+ Q X-Google-Smtp-Source: AGHT+IFfdcS9WIGNICK+kUzp0n8jmmrM3n//7htg6MRvG7UDKAPXbLVS11vuAZ33+xhBummvX2J8uw== X-Received: by 2002:a05:6808:aae:b0:3c7:35ce:67a4 with SMTP id r14-20020a0568080aae00b003c735ce67a4mr2459844oij.10.1714131239339; Fri, 26 Apr 2024 04:33:59 -0700 (PDT) Message-ID: <5ef9fef8-e5ee-4ce3-a78f-ee7c35e5a1a4@citrix.com> Date: Fri, 26 Apr 2024 12:33:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-GB To: xen-devel Cc: Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Roberto Bagnara , "consulting@bugseng.com" From: Andrew Cooper Subject: MISRA and -Wextra-semi Autocrypt: addr=andrew.cooper3@citrix.com; keydata= xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E ofTYAEh7R5HfPx0EX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ipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs 6+ahAA== Hi, Based on a call a long while back, I experimented with -Wextra-semi.  This is what lead to 8e36c668ca107 "xen: Drop superfluous semi-colons". However, there are a number of problems with getting this working fully.  First, we need workarounds like this: to avoid a failure for users, which do legitimately have a semi-colon.  It occurs to me that we could swap the typedef for as asm("") which might be a little less unpleasant. But with the simple cases taken care of, we then hit: In file included from common/grant_table.c:3813: common/compat/grant_table.c:10:1: error: extra ';' outside of a function [-Werror,-Wextra-semi] CHECK_grant_entry_v1; ^ which is quickly starting to unravel. Finally, while Clang does have -Wextra-semi working properly for C, GCC does this: cc1: warning: command-line option ‘-Wextra-semi’ is valid for C++/ObjC++ but not for C instead, which passes the cc-option-add check (which doesn't contain -Werror), but causes the real build to fail. So, while -Wextra-semi is definitely useful to find some hidden problems, it seems like using it fully might be very complicated.  How much do we care? ~Andrew diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h index d888b2314daf..12e99c6dded4 100644 --- a/xen/include/xen/config.h +++ b/xen/include/xen/config.h @@ -26,7 +26,7 @@    #include   -#define EXPORT_SYMBOL(var) +#define EXPORT_SYMBOL(var) typedef int var##_ignore_t    /*   * The following log levels are as follows: