From patchwork Fri Sep 24 20:32:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Madaminov X-Patchwork-Id: 1532468 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=GNGcs/J6; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGNyf36RJz9sPT for ; Sat, 25 Sep 2021 06:33:14 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 5691D421D7; Fri, 24 Sep 2021 20:33:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dSVSo2O8qOVE; Fri, 24 Sep 2021 20:33:11 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id A530540684; Fri, 24 Sep 2021 20:33:10 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6FEC2C0011; Fri, 24 Sep 2021 20:33:10 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 82A0BC000D for ; Fri, 24 Sep 2021 20:33:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 5D173406B6 for ; Fri, 24 Sep 2021 20:33:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3gRfaOfqgKN4 for ; Fri, 24 Sep 2021 20:33:08 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by smtp4.osuosl.org (Postfix) with ESMTPS id C476240684 for ; Fri, 24 Sep 2021 20:33:08 +0000 (UTC) Received: by mail-ot1-x336.google.com with SMTP id c6-20020a9d2786000000b005471981d559so14748288otb.5 for ; Fri, 24 Sep 2021 13:33:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SiIcrz1rdlVxmgX6Utv3KsgmJ34+Bp1bplnbgCSZld8=; b=GNGcs/J6VOUwn4opiibcyHy8Q37nmpET/VgO8/xot9Wcu5jLbRbDtV0DavNM/9m+Wt 0D7g8ILwRyh2l3jxhlsGwsMR1i+GEyOY8GSbMMlgL5lstIK0UHPz2J2qNBW0/yVliEp/ ASGSdBtQZB2eY9r0oJn87CA/hd1ojyNTOq0LLRjMNY+U7UbP7yMLHoswnjtvBpWfC+SJ v7U1ArhBC/PE+VTGgDFNnEYVSyQAGyHqYx0MIIOG/VTzSwBfRIM0S4V/0MwFz8she5Dy yS90Mm1l5A55I8dPH3zqerSlh5gOEEIT6fkzJfkiWBVAwNJdf97IS7ANeohcCjXTU+E7 a3LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SiIcrz1rdlVxmgX6Utv3KsgmJ34+Bp1bplnbgCSZld8=; b=dN1xT7ehUiNYywXJNqOzXwStnm2dAh6nwba+SqMXFFqfw41sWD7VwBLX3Nh1eZgjUX 9omQIDYmaFFpv7BS8AiZySdMqhpiNeGw4xmqYVxhd5kCvi/LkHdpYGWYaFV9mMvzT14+ xZ3p84Fo29YDKWP9yUlj6fmSVaKQftDzQXh9gLntTcMYk+cG0liHyP5pbB3QJtJhIWm8 R7j/IklGyiTAdJ9X7pmzZTSpHZkWN/aB7ghmpOJVp+WktWrj+eU3Xwpb4Pxb3o7SFEoR CfgU5c4I9TTp3kgPQIz7tPRC0XD2zauePZWx1JqdyR9g9tA3boeNeJCCN8z7SBA/14HR pHoQ== X-Gm-Message-State: AOAM533jE5+kS6ldfUImf8t2T8X1X5RdlZKmhDpzQpwZcP4tQ65bHRoG ipzcN2CBlGVSTJM16vifmgCUoAe9yHA= X-Google-Smtp-Source: ABdhPJwVHlOaYbPV1p4Ra/Y3XKYIQYTuafMyWzVJCGJ9ntn+mqwHT6FJ+uMXfZ/fec8tO0mfOsCs9Q== X-Received: by 2002:a9d:c41:: with SMTP id 59mr263826otr.163.1632515587430; Fri, 24 Sep 2021 13:33:07 -0700 (PDT) Received: from DESKTOP-QT7VSGO.localdomain (104-178-170-61.lightspeed.austtx.sbcglobal.net. [104.178.170.61]) by smtp.gmail.com with ESMTPSA id c37sm2289332otu.60.2021.09.24.13.33.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 13:33:06 -0700 (PDT) From: Sergey Madaminov To: dev@openvswitch.org Date: Fri, 24 Sep 2021 15:32:43 -0500 Message-Id: <20210924203243.465-1-sergey.madaminov@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Cc: Sergey Madaminov Subject: [ovs-dev] [PATCH] include/openvswitch/compiler.h: enable several OVS_ attributes for Clang in Windows X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Clang on Windows does not necessarily have '__GNUC__' defined when compiling OvS on Windows. However, it supports the attributes such as '__unused__' and the rest in this macro-defined branch. Instead of defining '__GNUC__' with a flag '-fgnuc_version=X' (X is a version), which may have a larger impact, I think that it is better to not define it unless absolutely necessary to avoid having to deal with potential compatability issues and third-party libraries. For example, POSIX threads library for Windows checks for GNU C version if it supports '__declspec' whenever '__GNUC__' is defined. Signed-off-by: Sergey Madaminov --- include/openvswitch/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/openvswitch/compiler.h b/include/openvswitch/compiler.h index cf009f826..3fe5fc4b5 100644 --- a/include/openvswitch/compiler.h +++ b/include/openvswitch/compiler.h @@ -37,7 +37,7 @@ #define OVS_NO_RETURN #endif -#if __GNUC__ && !__CHECKER__ +#if (__clang__ || __GNUC__) && !__CHECKER__ #define OVS_UNUSED __attribute__((__unused__)) #define OVS_PRINTF_FORMAT(FMT, ARG1) __attribute__((__format__(printf, FMT, ARG1))) #define OVS_SCANF_FORMAT(FMT, ARG1) __attribute__((__format__(scanf, FMT, ARG1)))