Re: Fwd: [PATCH] fix format security

Bruno Haible via Gnulib discussion list <[email protected]>
Newsgroups gmane.comp.lib.gnulib.bugs,gmane.editors.poke.devel
Message-ID <3246758.Io6jWrDuP8@cagnes>
Hi Luca,

> A user suggests changing
> 
>    error (exit_failure, errnum,
>          _("failed to return to initial working directory"));
> 
> to
> 
>    error (exit_failure, errnum,
>          "%s", _("unable to record current working directory"));
> 
> (twice) in openat-die.c, in order to silence a clang warning.  I see
> that the latest Gnulib is still without the format string.  What do you
> think?

First, make sure that you use the newest gettext.h from Gnulib. This
will fix the warning with gcc.

Then, if the warning still appears:

clang is buggy.

Use gcc instead of clang, or silence the warning through a -W option,
or ignore the warning.

More details here:
https://lists.gnu.org/archive/html/bug-gnulib/2025-05/msg00266.html
https://lists.gnu.org/archive/html/bug-gnulib/2025-06/msg00327.html
https://lists.gnu.org/archive/html/bug-gnulib/2026-01/msg00088.html

Bruno
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.