[PATCH 2/3] build: disable -Wformat-nonliteral

Bernhard Voelker <[email protected]>
Newsgroups gmane.comp.gnu.findutils.bugs,gmane.comp.gnu.findutils.patches
Message-ID <[email protected]>
GCC-10.2.1 complains about format strings it was not able to check:

  print.c:529:11: warning: format not a string literal, format string not \
                           checked [-Wformat-nonliteral]
    529 |           strftime (altbuf, buf_size, timefmt, &altered_time);
        |           ^~~~~~~~

* configure.ac (compiler-warnings): Add -Wformat-nonliteral.
---
 configure.ac | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure.ac b/configure.ac
index 58838422..729ecaf4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,6 +158,8 @@ AC_ARG_ENABLE(compiler-warnings,
   WARN_CFLAGS="$WARN_CFLAGS  -Wno-sign-compare"
   # Likewise for -Wunused-parameter: it is implied by -Wunused and -Wextra.
   gl_WARN_ADD([-Wno-unused-parameter])
+  # Likewise for -Wformat-nonliteral: it is implied by -Wformat.
+  gl_WARN_ADD([-Wno-format-nonliteral])
   ])
 
 dnl For --enable-compiler-warnings-are-errors, any GCC compiler
-- 
2.28.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.