diff --git a/.github/workflows/debian-bookworm.yml b/.github/workflows/debian-bookworm.yml index fb95bb4..06d0f84 100644 --- a/.github/workflows/debian-bookworm.yml +++ b/.github/workflows/debian-bookworm.yml @@ -21,17 +21,17 @@ jobs: - name: bootstrap run: ./bootstrap.sh - name: configure - run: ./configure --enable-warnings CXXFLAGS=-std=c++11 + run: ./configure --enable-warnings CXXFLAGS=-std=c++17 - name: make run: make - name: make check run: make check - name: make distcheck - run: make distcheck CXXFLAGS=-std=c++11 + run: make distcheck CXXFLAGS=-std=c++17 - name: build with hardened build flags run: | make clean - eval $(DEB_BUILD_MAINT_OPTIONS="hardening=+all qa=+all,-canary reproducible=+all" dpkg-buildflags --export=sh) + eval $(DEB_CXXFLAGS_APPEND=-std=c++17 DEB_BUILD_MAINT_OPTIONS="hardening=+all qa=+all,-canary reproducible=+all" dpkg-buildflags --export=sh) ./configure make make check diff --git a/.github/workflows/debian-bullseye.yml b/.github/workflows/debian-bullseye.yml index 5860fde..f1087bb 100644 --- a/.github/workflows/debian-bullseye.yml +++ b/.github/workflows/debian-bullseye.yml @@ -21,17 +21,17 @@ jobs: - name: bootstrap run: ./bootstrap.sh - name: configure - run: ./configure --enable-warnings CXXFLAGS=-std=c++11 + run: ./configure --enable-warnings CXXFLAGS=-std=c++17 - name: make run: make - name: make check run: make check - name: make distcheck - run: make distcheck CXXFLAGS=-std=c++11 + run: make distcheck CXXFLAGS=-std=c++17 - name: build with hardened build flags run: | make clean - eval $(DEB_BUILD_MAINT_OPTIONS="hardening=+all qa=+all,-canary reproducible=+all" dpkg-buildflags --export=sh) + eval $(DEB_CXXFLAGS_APPEND=-std=c++17 DEB_BUILD_MAINT_OPTIONS="hardening=+all qa=+all,-canary reproducible=+all" dpkg-buildflags --export=sh) ./configure make make check diff --git a/.github/workflows/debian-trixie.yml b/.github/workflows/debian-trixie.yml index d56e9f7..f13b320 100644 --- a/.github/workflows/debian-trixie.yml +++ b/.github/workflows/debian-trixie.yml @@ -21,17 +21,17 @@ jobs: - name: bootstrap run: ./bootstrap.sh - name: configure - run: ./configure --enable-warnings CXXFLAGS=-std=c++11 + run: ./configure --enable-warnings CXXFLAGS=-std=c++17 - name: make run: make - name: make check run: make check - name: make distcheck - run: make distcheck CXXFLAGS=-std=c++11 + run: make distcheck CXXFLAGS=-std=c++17 - name: build with hardened build flags run: | make clean - eval $(DEB_BUILD_MAINT_OPTIONS="hardening=+all qa=+all,-canary reproducible=+all" dpkg-buildflags --export=sh) + eval $(DEB_CXXFLAGS_APPEND=-std=c++17 DEB_BUILD_MAINT_OPTIONS="hardening=+all qa=+all,-canary reproducible=+all" dpkg-buildflags --export=sh) ./configure make make check diff --git a/.github/workflows/deterministic.yml b/.github/workflows/deterministic.yml index f30580e..9cf4ef1 100644 --- a/.github/workflows/deterministic.yml +++ b/.github/workflows/deterministic.yml @@ -11,7 +11,7 @@ on: jobs: build: name: Runs the deterministic operation test - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: checkout @@ -21,7 +21,7 @@ jobs: - name: bootstrap run: ./bootstrap.sh - name: configure - run: ./configure + run: ./configure CXXFLAGS=-std=c++17 - name: make run: make - name: run determinism test diff --git a/.github/workflows/fedora-40.yml b/.github/workflows/fedora-40.yml index 2570d08..ebc004d 100644 --- a/.github/workflows/fedora-40.yml +++ b/.github/workflows/fedora-40.yml @@ -21,13 +21,13 @@ jobs: - name: bootstrap run: ./bootstrap.sh - name: configure - run: ./configure --enable-warnings CXXFLAGS=-std=c++11 + run: ./configure --enable-warnings CXXFLAGS=-std=c++17 - name: make run: make -j $(nproc) - name: make check run: make check - name: make distcheck - run: make distcheck CXXFLAGS=-std=c++11 + run: make distcheck CXXFLAGS=-std=c++17 - name: store the logs as an artifact if: ${{ always() }} uses: actions/upload-artifact@v4 diff --git a/.github/workflows/fedora-41.yml b/.github/workflows/fedora-41.yml index 2da0ff2..572ad5c 100644 --- a/.github/workflows/fedora-41.yml +++ b/.github/workflows/fedora-41.yml @@ -21,13 +21,13 @@ jobs: - name: bootstrap run: ./bootstrap.sh - name: configure - run: ./configure --enable-warnings CXXFLAGS=-std=c++11 + run: ./configure --enable-warnings CXXFLAGS=-std=c++17 - name: make run: make -j $(nproc) - name: make check run: make check - name: make distcheck - run: make distcheck CXXFLAGS=-std=c++11 + run: make distcheck CXXFLAGS=-std=c++17 - name: store the logs as an artifact if: ${{ always() }} uses: actions/upload-artifact@v4 diff --git a/.github/workflows/gcc10.yml b/.github/workflows/gcc10.yml index 3bc67f7..ad9412e 100644 --- a/.github/workflows/gcc10.yml +++ b/.github/workflows/gcc10.yml @@ -21,7 +21,7 @@ jobs: - name: bootstrap run: ./bootstrap.sh - name: configure - run: ./configure CXX=g++-10 + run: ./configure CXX=g++-10 CXXFLAGS=-std=c++17 - name: build run: make - name: check diff --git a/.github/workflows/gcc11.yml b/.github/workflows/gcc11.yml index dbce946..57b5623 100644 --- a/.github/workflows/gcc11.yml +++ b/.github/workflows/gcc11.yml @@ -21,7 +21,7 @@ jobs: - name: bootstrap run: ./bootstrap.sh - name: configure - run: ./configure CXX=g++-11 + run: ./configure CXX=g++-11 CXXFLAGS=-std=c++17 - name: build run: make - name: check diff --git a/.github/workflows/gcc12.yml b/.github/workflows/gcc12.yml index f466ba1..42f4f51 100644 --- a/.github/workflows/gcc12.yml +++ b/.github/workflows/gcc12.yml @@ -21,7 +21,7 @@ jobs: - name: bootstrap run: ./bootstrap.sh - name: configure - run: ./configure CXX=g++-12 + run: ./configure CXX=g++-12 CXXFLAGS=-std=c++17 - name: build run: make - name: check diff --git a/.github/workflows/gcc13.yml b/.github/workflows/gcc13.yml index 14ab5c6..3a228e7 100644 --- a/.github/workflows/gcc13.yml +++ b/.github/workflows/gcc13.yml @@ -25,7 +25,7 @@ jobs: - name: bootstrap run: ./bootstrap.sh - name: configure - run: ./configure CXX=g++-13 + run: ./configure CXX=g++-13 CXXFLAGS=-std=c++17 - name: build run: make - name: check diff --git a/.github/workflows/gcc14.yml b/.github/workflows/gcc14.yml index 5a1c45e..5712790 100644 --- a/.github/workflows/gcc14.yml +++ b/.github/workflows/gcc14.yml @@ -20,7 +20,7 @@ jobs: - name: bootstrap run: ./bootstrap.sh - name: configure - run: ./configure CXX=g++-14 + run: ./configure CXX=g++-14 CXXFLAGS=-std=c++17 - name: build run: make - name: check diff --git a/.github/workflows/gcc9.yml b/.github/workflows/gcc9.yml index c2a9b6b..f4fd4f6 100644 --- a/.github/workflows/gcc9.yml +++ b/.github/workflows/gcc9.yml @@ -21,7 +21,7 @@ jobs: - name: bootstrap run: ./bootstrap.sh - name: configure - run: ./configure CXX=g++-9 + run: ./configure CXX=g++-9 CXXFLAGS=-std=c++17 - name: build run: make - name: check diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 6f487db..0e07f73 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -23,7 +23,7 @@ jobs: - name: bootstrap run: ./bootstrap.sh - name: configure - run: ./configure --enable-warnings CXXFLAGS="-std=c++11 -I$(brew --prefix nettle)/include -L$(brew --prefix nettle)/lib" + run: ./configure --enable-warnings CXXFLAGS="-std=c++17 -I$(brew --prefix nettle)/include -L$(brew --prefix nettle)/lib" - name: make run: make # tests fail because readlink does not understand -f on mac diff --git a/.github/workflows/ubuntu-default.yml b/.github/workflows/ubuntu-default.yml index e3ccd14..6902b4a 100644 --- a/.github/workflows/ubuntu-default.yml +++ b/.github/workflows/ubuntu-default.yml @@ -23,10 +23,10 @@ jobs: - name: bootstrap run: ./bootstrap.sh - name: configure - run: ./configure --enable-warnings CXXFLAGS=-std=c++11 + run: ./configure --enable-warnings CXXFLAGS=-std=c++17 - name: make run: make - name: make check run: make check - name: make distcheck - run: make distcheck CXXFLAGS=-std=c++11 + run: make distcheck CXXFLAGS=-std=c++17 diff --git a/NEWS b/NEWS index d72bf82..c33dd4d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +next +requires a C++17 capable compiler. 1.6.0 supports sha512 1.4.0alpha diff --git a/README.md b/README.md index 49e3bc6..d05a9ee 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ If you are on Mac, you can install through - [MacPorts](https://www.macports.org/) (direct link to [Portfile](https://github.com/macports/macports-ports/blob/master/sysutils/rdfind/Portfile)). - [brew](https://brew.sh/) direct link to [homebrew formulae](https://formulae.brew.sh/formula/rdfind) -If you want to compile the source yourself, that is fine. Rdfind is written in C++11 and should compile under any \*nix. +If you want to compile the source yourself, that is fine. Rdfind is written in C++17 and should compile under any \*nix. ### Windows diff --git a/configure.ac b/configure.ac index a9068fc..58a37fc 100644 --- a/configure.ac +++ b/configure.ac @@ -60,11 +60,11 @@ AC_CHECK_FUNC(stat,,AC_MSG_ERROR(oops! no stat ?!?)) dnl check for 64 bit support AC_SYS_LARGEFILE -dnl make sure we have c++11 or better, -AC_MSG_CHECKING([for C++11 support or better]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int f() { auto a=1;return a;}])], +dnl make sure we have c++17 or better, +AC_MSG_CHECKING([for C++17 support or better]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int f() { if constexpr(true) {auto a=1;return a;} else {return 2;}}])], [AC_MSG_RESULT([yes])], - [AC_MSG_ERROR([no c++11 support, please set CXXFLAGS properly])]) + [AC_MSG_ERROR([no c++17 support, please set CXXFLAGS properly])]) AC_SUBST(VERSION) diff --git a/cppcheck/run_cppcheck.sh b/cppcheck/run_cppcheck.sh index b1f93e3..523c01b 100755 --- a/cppcheck/run_cppcheck.sh +++ b/cppcheck/run_cppcheck.sh @@ -7,7 +7,7 @@ me=$(basename $0) mkdir -p $outdir -args="--enable=all --inconclusive --std=c++11 -I . --quiet --suppress=missingIncludeSystem" +args="--enable=all --inconclusive --std=c++17 -I . --quiet --suppress=missingIncludeSystem" # cppcheck can not produce an xml report and a reulgar text file at the same time, so run twice cppcheck $args *.cc *.hh --template='{severity}:{file}:{line}:{message}' 2>$outdir/cppcheck.out diff --git a/do_quality_checks.sh b/do_quality_checks.sh index da0a71d..4d8166f 100755 --- a/do_quality_checks.sh +++ b/do_quality_checks.sh @@ -100,15 +100,15 @@ compile_and_test() { #this is the test program to compile, so we know the compiler and standard lib #works. clang 4 with c++2a does not. /bin/echo -e "#include ">x.cpp - #does the compiler understand c++11? That is mandatory. - if ! $1 -c x.cpp -std=c++11 >/dev/null 2>&1 ; then - echo $me: this compiler $1 does not understand c++11 + #does the compiler understand c++17? That is mandatory. + if ! $1 -c x.cpp -std=c++17 >/dev/null 2>&1 ; then + echo $me: this compiler $1 does not understand c++17 return 0 fi - #loop over all standard flags>=11 and try those which work. + #loop over all standard flags>=17 and try those which work. #use the code words. - for std in 11 1y 1z 2a 2b ; do + for std in 1z 2a 2b ; do if ! $1 -c x.cpp -std=c++$std >/dev/null 2>&1 ; then echo $me: compiler does not understand c++$std, skipping this combination. else @@ -154,7 +154,7 @@ run_with_sanitizer() { start_from_scratch ./bootstrap.sh >bootstrap.log - ./configure $ASSERT CXX=$latestclang CXXFLAGS="-std=c++1y $1" >configure.log + ./configure $ASSERT CXX=$latestclang CXXFLAGS="-std=c++17 $1" >configure.log make > make.log 2>&1 export UBSAN_OPTIONS="halt_on_error=true exitcode=1" export ASAN_OPTIONS="halt_on_error=true exitcode=1" @@ -197,11 +197,11 @@ run_with_libcpp() { int main() { std::cout<<\"libc++ works!\"<x.cpp get_latest_clang if [ ! -z $latestclang ] ; then - if ! $latestclang -std=c++11 -stdlib=libc++ -lc++abi x.cpp >/dev/null 2>&1 || [ ! -x ./a.out ] || ! ./a.out ; then + if ! $latestclang -std=c++17 -stdlib=libc++ -lc++abi x.cpp >/dev/null 2>&1 || [ ! -x ./a.out ] || ! ./a.out ; then echo $me: "debug: $latestclang could not compile with libc++ - perhaps uninstalled." continue fi - compile_and_test_standard $latestclang c++11 "-stdlib=libc++ -D_LIBCPP_DEBUG=1" + compile_and_test_standard $latestclang c++17 "-stdlib=libc++ -D_LIBCPP_DEBUG=1" return fi # we will get here if no clang could be found. that is not an error, @@ -247,7 +247,7 @@ verify_self_contained_headers() { fi for header in *.hh ; do cp $header tmp.cc - if ! g++ -std=c++11 -I. -c tmp.cc -o /dev/null >header.log 2>&1 ; then + if ! g++ -std=c++17 -I. -c tmp.cc -o /dev/null >header.log 2>&1 ; then echo "$me: found a header which is not self contained: $header." echo "$me: see header.log for details" exit 1 @@ -349,7 +349,7 @@ run_with_debian_buildflags #make a test build with debug iterators ASSERT="--enable-assert" -compile_and_test_standard g++ c++11 "-D_GLIBCXX_DEBUG" +compile_and_test_standard g++ c++17 "-D_GLIBCXX_DEBUG" #test run with clang/libc++ ASSERT="--enable-assert" @@ -361,7 +361,7 @@ run_with_libcpp if which valgrind >/dev/null; then echo $me: running unit tests through valgrind ASSERT="--disable-assert" - compile_and_test_standard g++ c++11 "-O3" + compile_and_test_standard g++ c++17 "-O3" VALGRIND=valgrind make check >make-check.log fi diff --git a/rdfind.cc b/rdfind.cc index a83ea03..84e3f68 100644 --- a/rdfind.cc +++ b/rdfind.cc @@ -6,6 +6,9 @@ #include "config.h" //header file from autoconf +static_assert(__cplusplus >= 201703L, + "this code requires a C++17 capable compiler!"); + // std #include #include