From 367a871f30730adbb1598969909ae114cfa43af9 Mon Sep 17 00:00:00 2001 From: Mirko Dziadzka Date: Fri, 9 Feb 2024 21:57:31 +0100 Subject: [PATCH] Bump the C++ version from C++11 to C++17 This will allow the usage of more modern features in the future. --- README.md | 2 +- configure.ac | 4 ++-- examples/reading_logs_via_rule_message/Makefile.am | 2 +- examples/reading_logs_with_offset/Makefile.am | 2 +- examples/using_bodies_in_chunks/Makefile.am | 2 +- src/Makefile.am | 2 +- src/parser/Makefile.am | 3 +-- test/Makefile.am | 6 +++--- test/benchmark/Makefile.am | 2 +- test/fuzzer/Makefile.am | 2 +- tools/rules-check/Makefile.am | 2 +- 11 files changed, 14 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 615cbf11c3..3be0881080 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Windows build is not ready yet. ## Dependencies -This library is written in C++ using the C++11 standards. It also uses Flex +This library is written in C++ using the C++17 standards. It also uses Flex and Yacc to produce the “Sec Rules Language” parser. Other, mandatory dependencies include YAJL, as ModSecurity uses JSON for producing logs and its testing framework, libpcre (not yet mandatory) for processing regular expressions in SecRules, and libXML2 (not yet mandatory) which is used for parsing XML requests. All others dependencies are related to operators specified within SecRules or configuration directives and may not be required for compilation. A short list of such dependencies is as follows: diff --git a/configure.ac b/configure.ac index 66d6f4f2de..85ce105fa5 100644 --- a/configure.ac +++ b/configure.ac @@ -52,8 +52,8 @@ AC_PROG_MAKE_SET PKG_PROG_PKG_CONFIG -# Check if the compiler is c++11 compatible. -# AX_CXX_COMPILE_STDCXX_11(,mandatory) +# Check if the compiler is c++17 compatible. +# AX_CXX_COMPILE_STDCXX_17(,mandatory) # Check for libinjection if ! test -f "${srcdir}/others/libinjection/src/libinjection_html5.c"; then diff --git a/examples/reading_logs_via_rule_message/Makefile.am b/examples/reading_logs_via_rule_message/Makefile.am index 797ac752bd..cab135bc48 100644 --- a/examples/reading_logs_via_rule_message/Makefile.am +++ b/examples/reading_logs_via_rule_message/Makefile.am @@ -32,7 +32,7 @@ simple_request_LDFLAGS = \ simple_request_CPPFLAGS = \ $(GLOBAL_CFLAGS) \ - -std=c++11 \ + -std=c++17 \ -I$(top_builddir)/headers \ -I$(top_builddir) \ -g \ diff --git a/examples/reading_logs_with_offset/Makefile.am b/examples/reading_logs_with_offset/Makefile.am index b798c8c54a..33c8959db3 100644 --- a/examples/reading_logs_with_offset/Makefile.am +++ b/examples/reading_logs_with_offset/Makefile.am @@ -32,7 +32,7 @@ read_LDFLAGS = \ read_CPPFLAGS = \ $(GLOBAL_CFLAGS) \ - -std=c++11 \ + -std=c++17 \ -I$(top_builddir)/headers \ -I$(top_builddir) \ -g \ diff --git a/examples/using_bodies_in_chunks/Makefile.am b/examples/using_bodies_in_chunks/Makefile.am index 799efe7815..72f7bd2255 100644 --- a/examples/using_bodies_in_chunks/Makefile.am +++ b/examples/using_bodies_in_chunks/Makefile.am @@ -33,7 +33,7 @@ simple_request_LDFLAGS = \ simple_request_CPPFLAGS = \ $(GLOBAL_CFLAGS) \ - -std=c++11 \ + -std=c++17 \ -I$(top_builddir)/headers \ -I$(top_builddir) \ -g \ diff --git a/src/Makefile.am b/src/Makefile.am index 5078c4c0c8..39c9dc3243 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -311,7 +311,7 @@ libmodsecurity_la_CFLAGS = libmodsecurity_la_CPPFLAGS = \ - -std=c++11 \ + -std=c++17 \ -I.. \ -g \ -I../others \ diff --git a/src/parser/Makefile.am b/src/parser/Makefile.am index c5605d677a..1fc5731030 100644 --- a/src/parser/Makefile.am +++ b/src/parser/Makefile.am @@ -11,11 +11,10 @@ libmodsec_parser_la_SOURCES = \ test.cc libmodsec_parser_la_CPPFLAGS = \ - -std=c++11 \ + -std=c++17 \ -I../.. \ -I../../headers \ -I../../others \ - -std=c++11 \ -I.. \ -g \ -fPIC \ diff --git a/test/Makefile.am b/test/Makefile.am index 9237a87492..753e3a3826 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -70,7 +70,7 @@ unit_tests_LDFLAGS = \ unit_tests_CPPFLAGS = \ - -std=c++11 \ + -std=c++17 \ -Icommon \ -I../ \ -g \ @@ -126,7 +126,7 @@ regression_tests_LDFLAGS = \ regression_tests_CPPFLAGS = \ - -std=c++11 \ + -std=c++17 \ -Icommon \ -I../ \ -g \ @@ -179,7 +179,7 @@ rules_optimization_LDFLAGS = \ $(YAJL_LDFLAGS) rules_optimization_CPPFLAGS = \ - -std=c++11 \ + -std=c++17 \ -Icommon \ -I../ \ -g \ diff --git a/test/benchmark/Makefile.am b/test/benchmark/Makefile.am index 73a975b33a..865818caa2 100644 --- a/test/benchmark/Makefile.am +++ b/test/benchmark/Makefile.am @@ -32,7 +32,7 @@ benchmark_LDFLAGS = \ $(LUA_LDFLAGS) benchmark_CPPFLAGS = \ - -std=c++11 \ + -std=c++17 \ -I$(top_builddir)/headers \ $(GLOBAL_CPPFLAGS) \ $(PCRE_CFLAGS) \ diff --git a/test/fuzzer/Makefile.am b/test/fuzzer/Makefile.am index d1fd08dc7e..dc1b1e5078 100644 --- a/test/fuzzer/Makefile.am +++ b/test/fuzzer/Makefile.am @@ -30,7 +30,7 @@ afl_fuzzer_LDADD = \ afl_fuzzer_CPPFLAGS = \ - -std=c++11 \ + -std=c++17 \ -Icommon \ -I../ \ -I../../ \ diff --git a/tools/rules-check/Makefile.am b/tools/rules-check/Makefile.am index 615d9598ed..bd929383ef 100644 --- a/tools/rules-check/Makefile.am +++ b/tools/rules-check/Makefile.am @@ -28,7 +28,7 @@ modsec_rules_check_LDFLAGS = \ $(YAJL_LDFLAGS) modsec_rules_check_CPPFLAGS = \ - -std=c++11 \ + -std=c++17 \ -I$(top_builddir)/headers \ $(GLOBAL_CPPFLAGS) \ $(PCRE_CFLAGS) \