From: "plaisthos (Code Review)" Date: Mon, 20 Nov 2023 11:44:17 +0000 In-Reply-To: References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <5f92fe32ec5f21833530ad3979ea60d0df48d20b-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="daHe86YVlxA="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Remove unused/uneeded defines from configure and cmake config List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: openvpn-devel --daHe86YVlxA= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello flichtenheld, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/443?usp=3Demail to look at the new patch set (#2). Change subject: Remove unused/uneeded defines from configure and cmake conf= ig ...................................................................... Remove unused/uneeded defines 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: Ifd0376b36d4050dc22bc93b8fcf7ed29faef0021 --- M config.h.cmake.in M configure.ac M src/openvpn/mroute.h 3 files changed, 2 insertions(+), 45 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/43/443/2 diff --git a/config.h.cmake.in b/config.h.cmake.in index 19b79bc..25273ac 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -62,9 +62,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 @@ -139,9 +136,6 @@ /* Define to 1 if you have the `getpwnam' function. */ #cmakedefine HAVE_GETPWNAM -/* Define to 1 if you have the `getrlimit' function. */ -#undef HAVE_GETRLIMIT - /* Define to 1 if you have the `getsockname' function. */ #cmakedefine HAVE_GETSOCKNAME @@ -235,8 +229,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_PWD_H -/* Define to 1 if you have the `readv' function. */ -#undef HAVE_READV /* Define to 1 if you have the `recvmsg' function. */ #cmakedefine HAVE_RECVMSG @@ -383,9 +375,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H -/* Define to 1 if you have the `vsnprintf' function. */ -#undef HAVE_VSNPRINTF - /* we always assume a recent mbed TLS version */ #define HAVE_MBEDTLS_PSA_CRYPTO_H 1 #define HAVE_MBEDTLS_SSL_TLS_PRF 1 diff --git a/configure.ac b/configure.ac index 84eaad6..055b2a7 100644 --- a/configure.ac +++ b/configure.ac @@ -561,28 +561,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" @@ -655,7 +633,7 @@ AC_CHECK_FUNCS([ \ daemon chroot getpwnam setuid nice system dup dup2 \ syslog openlog mlockall getrlimit getgrnam setgid \ - setgroups flock readv writev time gettimeofday \ + setgroups flock time gettimeofday \ setsid chdir \ chsize ftruncate execve getpeereid basename dirname access \ epoll_create strsep \ diff --git a/src/openvpn/mroute.h b/src/openvpn/mroute.h index a06e872..7cfa18e 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/+/443?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: Ifd0376b36d4050dc22bc93b8fcf7ed29faef0021 Gerrit-Change-Number: 443 Gerrit-PatchSet: 2 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-MessageType: newpatchset --daHe86YVlxA= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: plaisthos.

plaisthos uploaded patch set #2 to this change.

<= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/443?usp=3Demail">View Chang= e

Remove unused/uneeded defines from configure and cmake config

= Anonymous unions/structs are technically a custom GNU C99 feature but
wa= s already widely supported by other compilers. With C11 this feature
has= become a standard feature so all compilers nowadays support it.

Cha= nge-Id: Ifd0376b36d4050dc22bc93b8fcf7ed29faef0021
---
M config.h.cmak= e.in
M configure.ac
M src/openvpn/mroute.h
3 files changed, 2 inse= rtions(+), 45 deletions(-)

git pull ssh://gerrit.openvpn.net:2941=
8/openvpn refs/changes/43/443/2
diff --git a/config.h.cmake.in b/co=
nfig.h.cmake.in
index 19b79bc..25273ac 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in@@ -62,9 +62,6 @@
/* Enable --x509-username-field = feature */
#cmakedefine ENABLE_X509ALTUSERNAME
<= span>
-/* Compiler sup= ports anonymous unions */
-#define HAVE_ANONYMOUS_UNION_SUPPORT
-
/* Define to 1 if you have the <arp= a/inet.h> header file. */
#cmakedefine HAVE_ARPA_INET_H= 1

@@ -139,9 +136,6 @@
/= * Define to 1 if you have the `getpwnam' function. */
= #cmakedefine HAVE_GETPWNAM

-/* Define to 1 if you have the `getrlimit' funct= ion. */
-#undef HAVE_GE= TRLIMIT
-
/* Define to 1 if you have the `getsockname' function. */ #cmakedefine HAVE_GETSOCKNAME

@@ = -235,8 +229,6 @@
/* Define to 1 if you have the <pwd.h&= gt; header file. */
#cmakedefine HAVE_PWD_H

-/* Define to 1 if = you have the `readv' function. */
-#undef HAVE_READV

/* Def= ine to 1 if you have the `recvmsg' function. */
#cmake= define HAVE_RECVMSG
@@ -383,9 +375,6 @@
/*= Define to 1 if you have the <vfork.h> header file. */
#undef HAVE_VFORK_H

-/* Define to 1 if you have the `vsnprintf' function.= */
-#undef HAVE_VSNPRI= NTF
-
= /* we always assume a recent mbed TLS version */
#define H= AVE_MBEDTLS_PSA_CRYPTO_H 1
#define HAVE_MBEDTLS_SSL_TLS_PR= F 1
diff --git a/configure.ac b/configure.ac
index 84eaad6..055b2a7 100644
--- a/configure.ac+++ b/configure.ac
@@ -561,28 +561,6 @@
<= span> ,
[[${SOCKET_INCLUDES}]]
)=
-AC_MSG_CHECKING([anonymous u= nion support])
-AC_COMP= ILE_IFELSE(
- [AC_LANG_= PROGRAM(
- [[- struct mystruct {- union {
- int m1;
- char m2;
- };
- };
- ]],
- [[
- struct mystruct s;
- s.m1 =3D 1; s.m2 =3D 2;
- ]]

- )],
- [
- AC_MSG_RESUL= T([yes])
- AC_DEFINE([= HAVE_ANONYMOUS_UNION_SUPPORT], [], [Compiler supports anonymous unions])
- ],
- [AC_MSG_RESULT([no])]
-)

save= d_LDFLAGS=3D"$LDFLAGS"
LDFLAGS=3D"$LDFLAGS = -Wl,--wrap=3Dexit"
@@ -655,7 +633,7 @@
AC_CHECK_FUNCS([ \

daemon chroot getpwnam setuid nice s= ystem dup dup2 \
syslog openlog mlockall getrlimit getgrn= am setgid \
- setgroups= flock readv writev time gettimeofday \
+ setgroups flock time gettimeofday \
= setsid chdir \
chsize ftruncate execve getpeereid basenam= e dirname access \
epoll_create strsep \
= diff --git a/src/openvpn/mroute.h b/src/openvpn/mroute.h
in= dex a06e872..7cfa18e 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_ANON= YMOUS_UNION_SUPPORT
-/*= Wrappers to support compilers that do not grok anonymous unions */<= br>- mroute_union-#define raw_addr mroute_union.= raw_addr
-#define ether= mroute_union.ether
-#d= efine v4 mroute_union.v4
-#define v4mappedv6 mroute_union.v4mappedv6
-#endif
- ;
+= };
};

/* Double-che= ck that struct packing works as expected */

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

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ifd0376b36d4050dc22bc93b8fcf= 7ed29faef0021
Gerrit-Change-Number: 443
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-MessageType: newpatchset
--daHe86YVlxA=--