From: "cron2 (Code Review)" Date: Thu, 12 Sep 2024 15:02:26 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="NT14pi1pA6E="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Remove check for anonymous unions from configure and cmake config List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --NT14pi1pA6E= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#4) to the change originally created by= plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/588?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by flichtenheld Change subject: Remove check for anonymous unions from configure and cmake = config ...................................................................... Remove check for anonymous unions from configure and cmake config Anonymous unions/structs are technically a custom GNU C99 feature but was already widely supported by other compilers. With C11 this feature has become a standard feature so all compilers nowadays support it. Change-Id: I1ef5f6f21f0135a628a63553c39515fa4549ce87 Signed-off-by: Arne Schwabe Acked-by: Frank Lichtenheld Message-Id: <20240710160238.190189-1-frank@...2641...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28= 914.html Signed-off-by: Gert Doering --- M config.h.cmake.in M configure.ac M src/openvpn/mroute.h 3 files changed, 1 insertion(+), 36 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/88/588/4 diff --git a/config.h.cmake.in b/config.h.cmake.in index 720d679..18af5e9 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -65,9 +65,6 @@ /* Enable --x509-username-field feature */ #cmakedefine ENABLE_X509ALTUSERNAME -/* Compiler supports anonymous unions */ -#define HAVE_ANONYMOUS_UNION_SUPPORT - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ARPA_INET_H 1 diff --git a/configure.ac b/configure.ac index 9e569bf..9bc15c8 100644 --- a/configure.ac +++ b/configure.ac @@ -564,28 +564,6 @@ , [[${SOCKET_INCLUDES}]] ) -AC_MSG_CHECKING([anonymous union support]) -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[ - struct mystruct { - union { - int m1; - char m2; - }; - }; - ]], - [[ - struct mystruct s; - s.m1 =3D 1; s.m2 =3D 2; - ]] - )], - [ - AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_ANONYMOUS_UNION_SUPPORT], [], [Compiler supports anonymo= us unions]) - ], - [AC_MSG_RESULT([no])] -) saved_LDFLAGS=3D"$LDFLAGS" LDFLAGS=3D"$LDFLAGS -Wl,--wrap=3Dexit" diff --git a/src/openvpn/mroute.h b/src/openvpn/mroute.h index bc58493..8b457d4 100644 --- a/src/openvpn/mroute.h +++ b/src/openvpn/mroute.h @@ -96,17 +96,7 @@ uint8_t prefix[12]; in_addr_t addr; /* _network order_ IPv4 address */ } v4mappedv6; - } -#ifndef HAVE_ANONYMOUS_UNION_SUPPORT -/* Wrappers to support compilers that do not grok anonymous unions */ - mroute_union -#define raw_addr mroute_union.raw_addr -#define ether mroute_union.ether -#define v4 mroute_union.v4 -#define v6 mroute_union.v6 -#define v4mappedv6 mroute_union.v4mappedv6 -#endif - ; + }; }; /* Double-check that struct packing works as expected */ -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/588?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I1ef5f6f21f0135a628a63553c39515fa4549ce87 Gerrit-Change-Number: 588 Gerrit-PatchSet: 4 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --NT14pi1pA6E= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #4 to the change originally cr= eated by plaisthos.

View Change

The following approvals got outdated= and were removed: Code-Review+2 by flichtenheld

Remove check for anonymous unions from config=
ure and cmake config

Anonymous unions/structs are technically a cust= om GNU C99 feature but
was already widely supported by other compilers. = With C11 this feature
has become a standard feature so all compilers now= adays support it.

Change-Id: I1ef5f6f21f0135a628a63553c39515fa4549ce= 87
Signed-off-by: Arne Schwabe <arne@...1227...>
Acked-by: Fran= k Lichtenheld <frank@...2641...>
Message-Id: <20240710160238.19= 0189-1-frank@...2641...>
URL: https://www.mail-archive.com/openvpn-de= vel@lists.sourceforge.net/msg28914.html
Signed-off-by: Gert Doering <= gert@...1296...>
---
M config.h.cmake.in
M configure.ac
M sr= c/openvpn/mroute.h
3 files changed, 1 insertion(+), 36 deletions(-)
<= br>
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/88/588/4=
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 720d679..18af5e9 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -65,9 +65,6 @@

/* Enable --x509-username-field feature */
#cm= akedefine ENABLE_X509ALTUSERNAME

-/* Compiler supports anonymous unions */
-#define HAVE_ANONYMOUS_UNIO= N_SUPPORT
-
<= span> /* Define to 1 if you have the <arpa/inet.h> header file. */
#cmakedefine HAVE_ARPA_INET_H 1

= diff --git a/configure.ac b/configure.ac
index 9e569b= f..9bc15c8 100644
--- a/configure.ac
+++ b/= configure.ac
@@ -564,28 +564,6 @@
,
[[${SOCKET_INCLUDES}]]
)
-AC_MSG_CHECKING([anonymous union support])=
-AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[
- struct mystruct {
- union {
- int m1;
- char m2;
- };
- }= ;
- ]],
- [[

- struct mystruct s;
- s.m1 =3D 1; s.m2 =3D 2;
- ]]
- )],
- [
- AC_MSG_RESULT([yes])
- AC_DEFINE([HAVE_ANONYMO= US_UNION_SUPPORT], [], [Compiler supports anonymous unions])
- ],

- [AC_MSG_RESULT([no])]
-)

saved_LDFLAGS=3D= "$LDFLAGS"
LDFLAGS=3D"$LDFLAGS -Wl,--wrap= =3Dexit"
diff --git a/src/openvpn/mroute.h b/src/openv= pn/mroute.h
index bc58493..8b457d4 100644
-= -- a/src/openvpn/mroute.h
+++ b/src/openvpn/mroute.h=
@@ -96,17 +96,7 @@
uint8_t prefix[12= ];
in_addr_t addr; /* _network order_ IPv4= address */
} v4mappedv6;
- }
-#ifndef HAVE_ANONYMOUS_UNION_SUPPORT
-/* Wrappers to support compilers that do not gr= ok anonymous unions */
= - mroute_union
-= #define raw_addr mroute_union.raw_addr
-#define ether mroute_union.ether
-#define v4 mroute_union.v4
-#define v6 mroute_union.v6
-#define v4mappedv6 mroute_union.v4map= pedv6

-#endif- ;
+ };
};
<= /span>
/* Double-check that struct packing works as expected */

To view, visit change 588. To unsubscribe, or= for help writing mail filters, visit settings.

<= /div>
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1ef5f6f21f0135a628a63553c39= 515fa4549ce87
Gerrit-Change-Number: 588
Gerrit-PatchSet: 4
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--NT14pi1pA6E=--