Vaclav Petras wrote:

> GCC warns me also about "format not a string literal and no format
> arguments". I remember this was once discussed on the ML but I'm not
> sure what the result was: the call is correct but the G_warning
> function needs some GCC attributes to specify what it is?

G_warning() already has a "format" attribute, which is why gcc
complains about the format string not being a string literal.

However, G_gettext() needs a "format_arg" attribute to to tell gcc
that one of arguments may be a format string, so that it stillcan
perform argument checking (and not generate "not a string literal"
warnings) when a format string is passed through that function (the
_(...) macro expands to a G_gettext() call when --with-nls is used).

Done in r57238.

With that change there are still 208 such warnings, but most of them
appear to indicate genuine bugs, i.e. passing arbitrary strings as
format strings, which will fail (e.g. crash) if the string contains
any % characters.

-- 
Glynn Clements <gl...@gclements.plus.com>


_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to