This was noticed with GCC 14.
* lib/xmemcoll.c: Always use format arguments.
* lib/xprintf.c: Likewise.
+2025-01-17 Pádraig Brady <P@draigBrady.com>
+
+ Avoid -Wformat=security failures with --disable-nls
+ This was noticed with GCC 14.
+ * lib/xmemcoll.c: Always use format arguments.
+ * lib/xprintf.c: Likewise.
+
2025-01-16 Bruno Haible <bruno@clisp.org>
getopt-posix: Fix compilation error in C++ mode (regression 2024-09-21).
/* Locale-specific memory comparison.
- Copyright (C) 2002-2004, 2006, 2009-2024 Free Software Foundation, Inc.
+ Copyright (C) 2002-2004, 2006, 2009-2025 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
char const *s1, size_t s1len,
char const *s2, size_t s2len)
{
- error (0, collation_errno, _("string comparison failed"));
- error (0, 0, _("Set LC_ALL='C' to work around the problem."));
+ error (0, collation_errno, "%s", _("string comparison failed"));
+ error (0, 0, "%s", _("Set LC_ALL='C' to work around the problem."));
error (exit_failure, 0,
_("The strings compared were %s and %s."),
quotearg_n_style_mem (0, locale_quoting_style, s1, s1len),
/* printf wrappers that fail immediately for non-file-related errors
- Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
{
int retval = vprintf (format, args);
if (retval < 0 && ! ferror (stdout))
- error (exit_failure, errno, gettext ("cannot perform formatted output"));
+ error (exit_failure, errno, "%s", gettext ("cannot perform formatted output"));
return retval;
}
{
int retval = vfprintf (stream, format, args);
if (retval < 0 && ! ferror (stream))
- error (exit_failure, errno, gettext ("cannot perform formatted output"));
+ error (exit_failure, errno, "%s", gettext ("cannot perform formatted output"));
return retval;
}