Hi,
Holger Hoffstätte wrote:
> Further inspection & trying to reproduce this in gnulib revealed that
> this requires a combination of -Werror=security and --disable-nls.
>
> To reproduce in gnulib:
>
> - clone gnulib
>
> - create a test dir:
> ./gnulib-tool --create-testdir --symlink --dir mytests
> (you can interrupt when it starts to configure)
>
> - reconfigure the project:
> cd mytests && ./configure --disable-nls CFLAGS="-pipe
> -Werror=format-security -O"
>
> - make will fail with an error like:
> clean-temp.c: In function 'create_temp_dir':
> clean-temp.c:234:7: error: format not a string literal and no format
> arguments [-Werror=format-security]
> 234 | error (0, errno,
> | ^~~~~
> clean-temp.c:234:7: error: format not a string literal and no format
> arguments [-Werror=format-security]
Thanks for the detailed "How to reproduce".
> The errors cannot be reproduced when nls is enabled, which suggests
> an implementation difference in the generated error() macros depending
> on the nls feature.
>
> Attached is a patch which fixes these failures, based on top of last
> night's gnulib git; they make the tests compile/run and were used to
> resolve the aforementioned problems in gettext and m4, though they
> obviously affect any gnulib consuming projects.
>
> I hope you find these useful!
Thanks. Yes, it is useful:
- The size of your patch makes it clear that this is not the way to go.
- The mention that it is specific to --disable-nls makes it clear that
we need to look for a workaround in gettext.h. I'll do some
experiments with various gcc versions and compiler options...
Bruno