From patchwork Thu Jun 29 10:39:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 3258 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7301:3c07:b0:d9:b492:11d6 with SMTP id ki7csp1713760dyb; Thu, 29 Jun 2023 03:41:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ68tuUcR1DqN7M/kxqWOiR9Hq3xKw6bsQE2dO1LivRIroAbdtI/IGAsK19+Q0AOfl0uE5io X-Received: by 2002:a05:6a20:4409:b0:127:76ab:a6ff with SMTP id ce9-20020a056a20440900b0012776aba6ffmr6126294pzb.22.1688035273337; Thu, 29 Jun 2023 03:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688035273; cv=none; d=google.com; s=arc-20160816; b=LmZbH8CRHXAhT6XZZ81JxOz9/iYOwNJPEvuRb1VC6O1xpBf6meohZX69wJOPDNIOEy dqQcdn0J9oHErBNY9E2111YDOuIbkhfvtmEmu8xDiaKkGb05/7JlR3enmdxrNv+lnulb zVhk3foKHuRBRwnR7WiRTxOrTbK5mVllQLwO4HWvfIjBQ5bqfI99abcmdGKnkGw7amKp 56kER8pQmUhjwPH+9AZNNaz8sVJhFUz3UH45oEqdF3snH7T4+OxnHxWM1vgA2paOyzQS D0fGw93Qfnorzz2mDMAvK2CoMDRN5DpudffbZvn0qP/55ilDzQ0qhDQOwu8cLr8B1zTC bB0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:dkim-signature; bh=ioo5h3YHjryn8u/r0cOcYjIaY2kFn/X6D8vnVA1h1Jo=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=ccSYvBBJxDXgSPLuRvR6+EQiIeqqcBAfc8USwHvfS+e19cWu0HskysBT07r82DZCtm zbEksqHNPYsIpz5UVqYsYNRwo6txR9C8xzC7zCYEM/6SjnwGOWU1Ptzhi/dL50SWDwbL wMAuW1j+VfFhZaw5uS0smQza5/VVcIYQOuD8lLJkxVUBcQtmL816q6hpl0pZeHqqm8To 6qnOSnQisr5c0pSZz6+vxLraaHQ7lqNPQ4inL2JIIz4hlwaA/43lpGQSVBIuEGy6oosx iPSMMcHCOFD8ddqndjFzE0sDDR3hNQXBuJ4lN/PCD/EoQlu5v06VIj2IivB31b/b4kp1 2qYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=jCxIAOMp; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=digXHdOo; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id t189-20020a6381c6000000b00553921dbc2csi10737193pgd.52.2023.06.29.03.41.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jun 2023 03:41:13 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=jCxIAOMp; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=digXHdOo; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1qEp4P-000846-Tm; Thu, 29 Jun 2023 10:40:14 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qEp4L-00083p-Mp for openvpn-devel@lists.sourceforge.net; Thu, 29 Jun 2023 10:40:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=FpSQD+6giX0Mfk8rvpLOaaf++hu+XErUCo4bLDYI6GM=; b=jCxIAOMpBkvEhwlnVfPteK/RkI wYMgo/ELPdfxz5gOK1Sc81TmJ/IIUaCEt0YhCYwiGTIKJoBEfqxtG98+xwaRaFue251AAl6wyeIsf TI1O1lq0S9MWOcRkyhFnSSBHKp51yXdNmlVM7S86jZnEpLXzqxJQsN9CBHN/jU1ccogg=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=FpSQD+6giX0Mfk8rvpLOaaf++hu+XErUCo4bLDYI6GM=; b=d igXHdOoviJjAH+j8R4nMSsRWhoGx/4MHhdZng3XewRyrRCNOfdljoMYMmfojorVmAsOP4pV7/jsXI kDOhUW6QhZfYCYyG5/eCXmVDbYDlDHfO4o2Z6SEWJtMbOzOTCt267VSMXItbnOIvwiGELM3JxgtmJ 4ouUqMr4TZICrnJY=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1qEp4I-0011Ae-J8 for openvpn-devel@lists.sourceforge.net; Thu, 29 Jun 2023 10:40:10 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.95 (FreeBSD)) (envelope-from ) id 1qEp45-0000Ph-Oy for openvpn-devel@lists.sourceforge.net; Thu, 29 Jun 2023 12:39:53 +0200 Received: (nullmailer pid 3238626 invoked by uid 10006); Thu, 29 Jun 2023 10:39:53 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Thu, 29 Jun 2023 12:39:53 +0200 Message-Id: <20230629103953.3238575-1-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Score: 0.3 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The -Wno-stringop-truncation flag is only supported by some GCC versions and not by Clang (macOS, FreeBSD) at all. Change-Id: I452bc4ee935d13f8e9095d0a31805a3bbaff0cec Signed-off-by: Arne Schwabe --- CMakeLists.txt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) Content analysis details: (0.3 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1qEp4I-0011Ae-J8 Subject: [Openvpn-devel] [PATCH] [CMake] Only add -Wno-stringop-truncation on supported compilers X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1770033274686779492?= X-GMAIL-MSGID: =?utf-8?q?1770033274686779492?= The -Wno-stringop-truncation flag is only supported by some GCC versions and not by Clang (macOS, FreeBSD) at all. Change-Id: I452bc4ee935d13f8e9095d0a31805a3bbaff0cec Signed-off-by: Arne Schwabe --- CMakeLists.txt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cbba5a38..ec0915bb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,14 @@ project(openvpn) # and OpenSSL having version 1.1.1+ and generally does not offer the same # configurability like autoconf +find_package(PkgConfig REQUIRED) +include(CheckSymbolExists) +include(CheckIncludeFiles) +include(CheckCCompilerFlag) +include(CheckTypeSize) +include(CheckStructHasMember) +include(CTest) + option(UNSUPPORTED_BUILDS "Allow unsupported builds" OFF) if (NOT WIN32 AND NOT ${UNSUPPORTED_BUILDS}) @@ -70,7 +78,10 @@ else () set(CMAKE_CXX_FLAGS_RELEASE "-O2") set(CMAKE_C_FLAGS_DEBUG "-g -O1") set(CMAKE_CXX_FLAGS_DEBUG "-g -O1") - add_compile_options(-Wall -Wuninitialized -Wno-stringop-truncation) + check_c_compiler_flag(-Wno-stringop-truncation NoStringOpTruncation) + if (${NoStringOpTruncation}) + add_compile_options(-Wall -Wuninitialized ) + endif() # We are not ready for this #add_compile_options(-Wconversion -Wno-sign-conversion -Wsign-compare) if (USE_WERROR) @@ -78,13 +89,6 @@ else () endif () endif () -find_package(PkgConfig REQUIRED) -include(CheckSymbolExists) -include(CheckIncludeFiles) -include(CheckTypeSize) -include(CheckStructHasMember) -include(CTest) - find_program(PYTHON NAMES python3 python) execute_process( COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/parse-version.m4.py ${CMAKE_CURRENT_SOURCE_DIR}/version.m4