Skip to contentSkip to conversation

Change in openvpn[master]: error: Remove our implementation of static_assert

Openvpn-devel In review flichtenheld (Code Review) 2 participants 6 messages Jan 13 – Jan 15 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1768318939000.I9cb14b9f44409ec5c78044ddb216a2b4dced0f9b@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1471?usp=email

to review the following change.

Change subject: error: Remove our implementation of static_assert
......................................................................

error: Remove our implementation of static_assert

It is C11, so it should be present in all our
compilers.

Change-Id I9cb14b9f44409ec5c78044ddb216a2b4dced0f9b

---
M src/openvpn/error.h

1 file changed, 0 insertions(+), 8 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/71/1471/1

src/openvpn/error.h +0 -8
index 44572b4..1198994 100644
@@ -245,14 +245,6 @@
 #endif
     ;
 
-/* Poor-man's static_assert() for when not supplied by assert.h, taken from
- * Linux's sys/cdefs.h under GPLv2 */
-#ifndef static_assert
-#define static_assert(expr, diagnostic)            \
-    extern int (*__OpenVPN_static_assert_function( \
-        void))[!!sizeof(struct { int __error_if_negative : (expr) ? 2 : -1; })]
-#endif
-
 /* Inline functions */
 
 static inline bool

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1471?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I9cb14b9f44409ec5c78044ddb216a2b4dced0f9b
Gerrit-Change-Number: 1471
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

cron2 has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1471?usp=email )

Change subject: error: Remove our implementation of static_assert
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1471?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I9cb14b9f44409ec5c78044ddb216a2b4dced0f9b
Gerrit-Change-Number: 1471
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Thu, 15 Jan 2026 09:25:28 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#3 lore raw

PATCH 1/1 error: Remove our implementation of static_assert

In reply to a message not in the archive

From: Frank Lichtenheld <[email protected]...>

It is C11, so it should be present in all our
compilers.

Change-Id I9cb14b9f44409ec5c78044ddb216a2b4dced0f9b

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1471
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1471
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

src/openvpn/error.h +0 -8
index 44572b4..1198994 100644
@@ -245,14 +245,6 @@
 #endif
     ;
 
-/* Poor-man's static_assert() for when not supplied by assert.h, taken from
- * Linux's sys/cdefs.h under GPLv2 */
-#ifndef static_assert
-#define static_assert(expr, diagnostic)            \
-    extern int (*__OpenVPN_static_assert_function( \
-        void))[!!sizeof(struct { int __error_if_negative : (expr) ? 2 : -1; })]
-#endif
-
 /* Inline functions */
 
 static inline bool
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: error: Remove our implementation of static_assert

Easy enough, and BB agrees that it still compiles fine on all formally supported platforms (= we did not test Haiku or AIX, but even those have gcc and should be fine).

URL links to sf.net today, because mail-archive.org is not working right.

Your patch has been applied to the master branch.

commit 6768ef1dab5cb6c1dbc210c20cf92820a64dace3

Author: Frank Lichtenheld
Date:   Thu Jan 15 10:25:47 2026 +0100
     error: Remove our implementation of static_assert

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1471
     Message-Id: <[email protected]...>
     URL: https://sourceforge.net/p/openvpn/mailman/message/59283672/
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1471?usp=email )

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

Change subject: error: Remove our implementation of static_assert
......................................................................

error: Remove our implementation of static_assert

It is C11, so it should be present in all our
compilers.

Change-Id I9cb14b9f44409ec5c78044ddb216a2b4dced0f9b

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1471
Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/59283672/

---
M src/openvpn/error.h

1 file changed, 0 insertions(+), 8 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/71/1471/2

src/openvpn/error.h +0 -8
index 44572b4..1198994 100644
@@ -245,14 +245,6 @@
 #endif
     ;
 
-/* Poor-man's static_assert() for when not supplied by assert.h, taken from
- * Linux's sys/cdefs.h under GPLv2 */
-#ifndef static_assert
-#define static_assert(expr, diagnostic)            \
-    extern int (*__OpenVPN_static_assert_function( \
-        void))[!!sizeof(struct { int __error_if_negative : (expr) ? 2 : -1; })]
-#endif
-
 /* Inline functions */
 
 static inline bool

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1471?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I9cb14b9f44409ec5c78044ddb216a2b4dced0f9b
Gerrit-Change-Number: 1471
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1471?usp=email )

Change subject: error: Remove our implementation of static_assert
......................................................................

error: Remove our implementation of static_assert

It is C11, so it should be present in all our
compilers.

Change-Id I9cb14b9f44409ec5c78044ddb216a2b4dced0f9b

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1471
Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/59283672/

---
M src/openvpn/error.h

1 file changed, 0 insertions(+), 8 deletions(-)
src/openvpn/error.h +0 -8
index 44572b4..1198994 100644
@@ -245,14 +245,6 @@
 #endif
     ;
 
-/* Poor-man's static_assert() for when not supplied by assert.h, taken from
- * Linux's sys/cdefs.h under GPLv2 */
-#ifndef static_assert
-#define static_assert(expr, diagnostic)            \
-    extern int (*__OpenVPN_static_assert_function( \
-        void))[!!sizeof(struct { int __error_if_negative : (expr) ? 2 : -1; })]
-#endif
-
 /* Inline functions */
 
 static inline bool

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1471?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I9cb14b9f44409ec5c78044ddb216a2b4dced0f9b
Gerrit-Change-Number: 1471
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>