From patchwork Sun Mar 28 01:22:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1668 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director8.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id qMEdN1p1YGC9bwAAIUCqbw (envelope-from ) for ; Sun, 28 Mar 2021 08:23:54 -0400 Received: from proxy9.mail.ord1d.rsapps.net ([172.30.191.6]) by director8.mail.ord1d.rsapps.net with LMTP id cBruNlp1YGBPOAAAfY0hYg (envelope-from ) for ; Sun, 28 Mar 2021 08:23:54 -0400 Received: from smtp36.gate.ord1c ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy9.mail.ord1d.rsapps.net with LMTPS id MECkNlp1YGD5UwAA7h+8OQ (envelope-from ) for ; Sun, 28 Mar 2021 08:23:54 -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: smtp36.gate.ord1c.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: 75c70404-8fc0-11eb-b0f2-5452006630bd-1-1 Received: from [216.105.38.7] ([216.105.38.7:54670] helo=lists.sourceforge.net) by smtp36.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 8D/04-14803-A5570606; Sun, 28 Mar 2021 08:23:54 -0400 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1lQURl-0007CU-Pe; Sun, 28 Mar 2021 12:23:13 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQURj-0007CG-Am for openvpn-devel@lists.sourceforge.net; Sun, 28 Mar 2021 12:23:11 +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=JwQBRQ7lyflywG7+AZw1kcwm/ZQ4yPlWIBANJXKv9zo=; b=DUpYnrb5m2wnS624ObyC0AX2NF EXDnu37gvn5qjF7oR08XpNpeMDa58jT6AZ9qtmyDbmPYKEYM7hNblUV3x10v70A2OODRCy7ZuTKvp 2oORij+UEfWZm0O+l+fRZbGLMWvWw0ujWPKXJercgOA6SHStc5F/PD7EpQcIjpAc8C0E=; 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=JwQBRQ7lyflywG7+AZw1kcwm/ZQ4yPlWIBANJXKv9zo=; b=ZDIALjfY71wOj6rjcWevFkMT17 KjWHe7stKURvAxxXXbYiGoJSe6bIfwWwBguiLQUWz1HKKK3K1gprjEC4BI6ONJ8Iasyi0kGBCGyfw c+/kztB44Bx1yvxe4FWU7YONufIEy1kGyyGDp/6CbdscYPrO1m16xenrSjtdjcR7jI+A=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1lQURb-004LUJ-Fp for openvpn-devel@lists.sourceforge.net; Sun, 28 Mar 2021 12:23:11 +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 1lQURT-0003AP-8A for openvpn-devel@lists.sourceforge.net; Sun, 28 Mar 2021 14:22:55 +0200 Received: (nullmailer pid 29810 invoked by uid 10006); Sun, 28 Mar 2021 12:22:55 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Sun, 28 Mar 2021 14:22:55 +0200 Message-Id: <20210328122255.29764-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: 1lQURb-004LUJ-Fp Subject: [Openvpn-devel] [PATCH] 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 Signed-off-by: Arne Schwabe Acked-by: Steffan Karger --- config-msvc.h | 1 - m4/ax_emptyarray.m4 | 40 ---------------------------------------- src/openvpn/circ_list.h | 2 +- src/openvpn/syshead.h | 2 -- 4 files changed, 1 insertion(+), 44 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/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