From patchwork Sun Mar 28 03:20:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1671 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director15.mail.ord1d.rsapps.net ([172.27.255.9]) by backend30.mail.ord1d.rsapps.net with LMTP id +APTEv2QYGAQVAAAIUCqbw (envelope-from ) for ; Sun, 28 Mar 2021 10:21:49 -0400 Received: from proxy14.mail.iad3a.rsapps.net ([172.27.255.9]) by director15.mail.ord1d.rsapps.net with LMTP id IISFEv2QYGD1MwAAIcMcQg (envelope-from ) for ; Sun, 28 Mar 2021 10:21:49 -0400 Received: from smtp31.gate.iad3a ([172.27.255.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy14.mail.iad3a.rsapps.net with LMTPS id kLzsNP6QYGBwBQAA1+b4IQ (envelope-from ) for ; Sun, 28 Mar 2021 10:21:50 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp31.gate.iad3a.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: ede96ac0-8fd0-11eb-ac51-5254003d9392-1-1 Received: from [216.105.38.7] ([216.105.38.7:53850] helo=lists.sourceforge.net) by smtp31.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 52/96-11166-BF090606; Sun, 28 Mar 2021 10:21:47 -0400 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.92.3) (envelope-from ) id 1lQWHc-0005eB-Uq; Sun, 28 Mar 2021 14:20:52 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1lQWHb-0005e4-Ij for openvpn-devel@lists.sourceforge.net; Sun, 28 Mar 2021 14:20:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding: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=63j5S5h56j+K0U3dTgoZDQJ14Nb+DHDe9LQ8lnBkWwQ=; b=QlGiVhBjnqbdnpU5p0Cst5NhUB BfPHLb8UpHNCIuAjCtkygeDhfB4N76Oi2pHnskNebdp8ww8TgFc0bFirEv4WWUwjTLFp6yAaVlurs vBzPB9ORNM3dX7i49W1NJDT1DHhNuntDWi0+BoqVq9g9Yt35io9xQxg1JQP/j9M/j1c8=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:MIME-Version: Content-Type:Content-Transfer-Encoding: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=63j5S5h56j+K0U3dTgoZDQJ14Nb+DHDe9LQ8lnBkWwQ=; b=lK0D4yJX85iOoLWMjKqHehJmTx +lIVr62Wm6iQ0f3vA3kzScSDZiT/np4BVKCVSTvrqmJyC35AwNNozZmKstI6rSMARZrqlq3YMZVVR evUnrgCvMkJFg5nm/XaHu2ZFFh/v4r8K9VZZuoF55/rhIwyjdGe9ZUZ2wHxU7gUB6ZvE=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lQWHW-0007Ev-Hk for openvpn-devel@lists.sourceforge.net; Sun, 28 Mar 2021 14:20:51 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.94 (FreeBSD)) (envelope-from ) id 1lQWHP-0003QZ-9N for openvpn-devel@lists.sourceforge.net; Sun, 28 Mar 2021 16:20:39 +0200 Received: (nullmailer pid 8870 invoked by uid 10006); Sun, 28 Mar 2021 14:20:38 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Sun, 28 Mar 2021 16:20:37 +0200 Message-Id: <20210328142038.8826-1-arne@rfc2549.org> X-Mailer: git-send-email 2.17.1 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rfc2549.org] 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: 1lQWHW-0007Ev-Hk Subject: [Openvpn-devel] [PATCH v2 1/2] Remove flexible array member autoconf check 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: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox This is configure macro that tries out how to declare a variable array at the end of struct. This has been standardised in C99, so there is no more need for non C99 magic. See also this stackoverflow discussion: https://stackoverflow.com/questions/14643406/whats-the-need-of-array-with-zero-elements Patch V2: Also remove AX_EMPTY_ARRAY from configure.ac Signed-off-by: Arne Schwabe Acked-by: Gert Doering --- config-msvc.h | 1 - configure.ac | 1 - m4/ax_emptyarray.m4 | 40 ---------------------------------------- src/openvpn/circ_list.h | 2 +- src/openvpn/syshead.h | 2 -- 5 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 m4/ax_emptyarray.m4 diff --git a/config-msvc.h b/config-msvc.h index e430ca96f..0260927ce 100644 --- a/config-msvc.h +++ b/config-msvc.h @@ -119,7 +119,6 @@ #define inline __inline #endif -#define EMPTY_ARRAY_SIZE 0 #define TARGET_WIN32 1 #define TARGET_ALIAS "Windows-MSVC" diff --git a/configure.ac b/configure.ac index 428bebeda..c17266a0a 100644 --- a/configure.ac +++ b/configure.ac @@ -421,7 +421,6 @@ AC_TYPE_SIGNAL AX_CPP_VARARG_MACRO_ISO AX_CPP_VARARG_MACRO_GCC AX_TYPE_SOCKLEN_T -AX_EMPTY_ARRAY AC_CHECK_SIZEOF([unsigned int]) AC_CHECK_SIZEOF([unsigned long]) AC_CHECK_HEADERS([ \ diff --git a/m4/ax_emptyarray.m4 b/m4/ax_emptyarray.m4 deleted file mode 100644 index c6781c179..000000000 --- a/m4/ax_emptyarray.m4 +++ /dev/null @@ -1,40 +0,0 @@ -dnl @synopsis AX_EMPTY_ARRAY -dnl -dnl Define EMPTY_ARRAY_SIZE to be either "0" -dnl or "" depending on which syntax the compiler -dnl prefers for empty arrays in structs. -dnl -dnl @version -dnl @author James Yonan -AC_DEFUN([AX_EMPTY_ARRAY], [ - AS_VAR_PUSHDEF([VAR],[ax_cv_c_empty_array])dnl - AC_CACHE_CHECK( - [for C compiler empty array size], - [VAR], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - , - [[ -struct { int foo; int bar[0]; } mystruct; - ]] - )], - [VAR=0], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - , - [[ -struct { int foo; int bar[]; } mystruct; - ]] - )], - [VAR=], - [AC_MSG_ERROR([C compiler is unable to creaty empty arrays])] - )] - )] - )dnl - AC_DEFINE_UNQUOTED( - [EMPTY_ARRAY_SIZE], - [$VAR], - [Dimension to use for empty array declaration] - )dnl - AS_VAR_POPDEF([VAR])dnl -]) diff --git a/src/openvpn/circ_list.h b/src/openvpn/circ_list.h index 23b42d2ab..ba9115eab 100644 --- a/src/openvpn/circ_list.h +++ b/src/openvpn/circ_list.h @@ -34,7 +34,7 @@ int x_size; \ int x_cap; \ int x_sizeof; \ - type x_list[EMPTY_ARRAY_SIZE]; \ + type x_list[]; \ } #define CIRC_LIST_PUSH(obj, item) \ diff --git a/src/openvpn/syshead.h b/src/openvpn/syshead.h index 5ee9bf1e8..cf9714593 100644 --- a/src/openvpn/syshead.h +++ b/src/openvpn/syshead.h @@ -392,8 +392,6 @@ typedef int MIB_TCP_STATE; #ifdef PEDANTIC #undef HAVE_CPP_VARARG_MACRO_GCC #undef HAVE_CPP_VARARG_MACRO_ISO -#undef EMPTY_ARRAY_SIZE -#define EMPTY_ARRAY_SIZE 1 #undef inline #define inline #endif