[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#996918: hunspell: FTBFS: format not a string literal and no format arguments



Source: hunspell
Version: 1.7.0-3
Severity: serious
Tags: ftbfs bookworm sid patch

Your package FTBFS in unstable, here is the relevant part of my build
log:

,----
| g++ -DHAVE_CONFIG_H -I. -I../..  -I../../src/hunspell -I../../src/hunspell -I../../src/parsers -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -ffile-prefix-map=/usr/local/src/deb-src/hunspell/hunspell=. -fstack-protector-strong -Wformat -Werror=format-security -c -o munch.o munch.cxx
| hunspell.cxx: In function 'char* scanline(char*)':
| hunspell.cxx:584:9: error: format not a string literal and no format arguments [-Werror=format-security]
|   584 |   printw(message);
|       |   ~~~~~~^~~~~~~~~
`----

This happened because ncurses added format attributes to several
functions, and dpkg-buildpackage defaults to -Werror=format-security.
For details about the ncurses change, see #993179.

I have attached a simple patch which could be added to the series in
debian/patches, but there are also a few warnings which might be worth
looking at.

From 91148a568c5994768e660ca5a968df16ae4a146c Mon Sep 17 00:00:00 2001
From: Sven Joachim <svenjoac@gmx.de>
Date: Wed, 20 Oct 2021 19:40:36 +0200
Subject: [PATCH] Fix string format error with recent ncurses

---
 src/tools/hunspell.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tools/hunspell.cxx b/src/tools/hunspell.cxx
index 690e34a..b165634 100644
--- a/src/tools/hunspell.cxx
+++ b/src/tools/hunspell.cxx
@@ -581,7 +581,7 @@ const char* basename(const char* s, char c) {
 #ifdef HAVE_CURSES_H
 char* scanline(char* message) {
   char input[INPUTLEN];
-  printw(message);
+  printw("%s", message);
   echo();
   getnstr(input, INPUTLEN);
   noecho();
--
2.33.0


Reply to: