diff options
author | Wayne Davison <wayne@opencoder.net> | 2020-09-29 15:17:29 -0700 |
---|---|---|
committer | Wayne Davison <wayne@opencoder.net> | 2020-09-29 15:30:20 -0700 |
commit | cd018c7a4c40a4d4f2aa3ea24f77282efe213c40 (patch) | |
tree | 6ccd09f4d9ba07f1dc3cf6d245008d0c3ae87b72 /configure.ac | |
parent | 9fce0eb5ab80da4d4d97bcde346c9b0b92432ac8 (diff) | |
download | rsync-cd018c7a4c40a4d4f2aa3ea24f77282efe213c40.tar.gz |
Use a better -Wno-pedantic heuristic.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 1116e658..3fd7e5d5 100644 --- a/configure.ac +++ b/configure.ac @@ -1053,9 +1053,10 @@ if test x"$GCC" = x"yes"; then else # Our internal popt code cannot be compiled with pedantic warnings as errors, so try to # turn off pedantic warnings (which will not lose the error for array-init overflow). - case `$CC -dumpversion 2>/dev/null` in - 4.*) ;; # Early gcc doesn't understand -Wno-pedantic - *) CFLAGS="$CFLAGS -pedantic-errors -Wno-pedantic" ;; + # Older gcc versions don't understand -Wno-pedantic, so check if --help=warnings lists + # -Wpedantic and use that as a flag. + case `$CC --help=warnings 2>/dev/null | grep Wpedantic` in + *-Wpedantic*) CFLAGS="$CFLAGS -pedantic-errors -Wno-pedantic" ;; esac fi fi |