From: "cron2 (Code Review)" Date: Fri, 9 May 2025 10:19:16 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <858ce927810623092225a56aa6369e5b6965221e-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="bIicCEQUz+Y="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: CMake: Sync list of compiler flags with configure.ac List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --bIicCEQUz+Y= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#3) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/923?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by plaisthos Change subject: CMake: Sync list of compiler flags with configure.ac ...................................................................... CMake: Sync list of compiler flags with configure.ac Also fix one issue reported by the build. Change-Id: I28af9eac2e9fb615903a82c8f4087602b72c134d Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Message-Id: <20250509090936.18818-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31= 604.html Signed-off-by: Gert Doering --- M CMakeLists.txt M tests/unit_tests/openvpn/test_cryptoapi.c 2 files changed, 11 insertions(+), 6 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/23/923/3 diff --git a/CMakeLists.txt b/CMakeLists.txt index 6687b56..c19d29a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,13 @@ CACHE STRING "Flags used by the C++ compiler during AddressSanitizer b= uilds." FORCE) +function(check_and_add_compiler_flag flag variable) + check_c_compiler_flag(${flag} ${variable}) + if (${variable}) + add_compile_options(${flag}) + endif() +endfunction() + if (MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE = -D_WINSOCK_DEPRECATED_NO_WARNINGS) if (USE_WERROR) @@ -96,11 +103,9 @@ endif() else () add_compile_options(-Wall -Wuninitialized) - check_c_compiler_flag(-Wno-stringop-truncation NoStringOpTruncation) - - if (${NoStringOpTruncation}) - add_compile_options(-Wno-stringop-truncation) - endif() + check_and_add_compiler_flag(-Wno-stringop-truncation NoStringOpTruncat= ion) + check_and_add_compiler_flag(-Wstrict-prototypes StrictPrototypes) + check_and_add_compiler_flag(-Wold-style-definition OldStyleDefinition) # We are not ready for this #add_compile_options(-Wconversion -Wno-sign-conversion -Wsign-compare) if (USE_WERROR) diff --git a/tests/unit_tests/openvpn/test_cryptoapi.c b/tests/unit_tests/o= penvpn/test_cryptoapi.c index 98102ef..478995f 100644 --- a/tests/unit_tests/openvpn/test_cryptoapi.c +++ b/tests/unit_tests/openvpn/test_cryptoapi.c @@ -116,7 +116,7 @@ /* Fill-in certs[] array */ void -init_cert_data() +init_cert_data(void) { struct test_cert certs_local[] =3D { {cert1, key1, cname1, "OVPN TEST CA1", "OVPN Test Cert 1", ha= sh1, 1}, -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/923?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: I28af9eac2e9fb615903a82c8f4087602b72c134d Gerrit-Change-Number: 923 Gerrit-PatchSet: 3 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --bIicCEQUz+Y= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #3 to the change originally cr= eated by flichtenheld.

View Change

The following approvals got outda= ted and were removed: Code-Review+2 by plaisthos

CMake: Sync list of compiler flags with configur=
e.ac

Also fix one issue reported by the build.

Change-Id: I28= af9eac2e9fb615903a82c8f4087602b72c134d
Signed-off-by: Frank Lichtenheld = <frank@...2641...>
Acked-by: Arne Schwabe <arne-openvpn@...1830...= ...>
Message-Id: <20250509090936.18818-1-gert@...1296...>
UR= L: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg3160= 4.html
Signed-off-by: Gert Doering <gert@...1296...>
---
M C= MakeLists.txt
M tests/unit_tests/openvpn/test_cryptoapi.c
2 files cha= nged, 11 insertions(+), 6 deletions(-)

git pull ssh://gerrit.open=
vpn.net:29418/openvpn refs/changes/23/923/3
diff --git a/CMakeLists=
.txt b/CMakeLists.txt
index 6687b56..c19d29a 100644<= br>--- a/CMakeLists.txt
+++ b/CMakeLists.txt@@ -66,6 +66,13 @@
CACHE STRING "Flags us= ed by the C++ compiler during AddressSanitizer builds."
FORCE)

+function(check_and_add_compiler_flag flag variable)
<= span style=3D"color: hsl(120, 100%, 40%);">+ check_c_compiler_flag(${fla= g} ${variable})
+ = if (${variable})
+ = add_compile_options(${flag})
+ endif()
+endfunction()
+=
if (MSVC)
add_definitions(-D_CRT_SEC= URE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_WINSOCK_DEPRECATED_NO_WARNIN= GS)
if (USE_WERROR)
@@ -96,11 +103,9 @= @
endif()
else ()
= add_compile_options(-Wall -Wuninitialized)
- check_c_compiler_flag(-Wno-stringop-truncation N= oStringOpTruncation)
-<= /span>
- if (${NoStringOpTr= uncation})
- add= _compile_options(-Wno-stringop-truncation)
- endif()
+ check_and_add_compiler_flag(-Wno-stringop-truncation NoStr= ingOpTruncation)
+ = check_and_add_compiler_flag(-Wstrict-prototypes StrictPrototypes)+ check_and_add_compiler_f= lag(-Wold-style-definition OldStyleDefinition)
# We ar= e not ready for this
#add_compile_options(-Wconversion= -Wno-sign-conversion -Wsign-compare)
if (USE_WERROR)<= /span>
diff --git a/tests/unit_tests/openvpn/test_cryptoapi.c b/te= sts/unit_tests/openvpn/test_cryptoapi.c
index 98102ef..4789= 95f 100644
--- a/tests/unit_tests/openvpn/test_cryptoapi.c<= /span>
+++ b/tests/unit_tests/openvpn/test_cryptoapi.c
<= span>@@ -116,7 +116,7 @@


/* Fill-in cert= s[] array */
void
-init_cert_data()
+init_cert_data(void)
{
stru= ct test_cert certs_local[] =3D {
{cert1, key1, c= name1, "OVPN TEST CA1", "OVPN Test Cert 1", hash1, = 1},

To view, visit change 923. To unsubscrib= e, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I28af9eac2e9fb615903a82c8f40= 87602b72c134d
Gerrit-Change-Number: 923
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--bIicCEQUz+Y=--