[systemd-devel] [PATCH] Add some extra __attribute__ ((format)) s

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Thu Apr 25 18:56:08 PDT 2013


On Fri, Apr 05, 2013 at 06:06:19PM +0200, Lennart Poettering wrote:
> On Fri, 05.04.13 05:30, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:
> 
> > unfortunately this one gives a warning during compilation (gcc-4.7.2-8.fc18.x86_64):
> > 
> > ../src/core/unit.c: In function 'unit_status_printf':
> > ../src/core/unit.c:2556:9: warning: format not a string literal,
> > argument types not checked [-Wformat-nonliteral]
> 
> Sounds like something to deal with via:
> 
> #pragma GCC diagnostic push
> #pragma GCC diagnostic ignored "-Wformat-nonliteral"
> ...
> #pragma GCC diagnostic pop
> 
> We use it in a couple of other cases too where it is actually OK to pass
> a variable as format string...
Applied, with suggested change, and a few other fixups in subsequent commit.

Zbyszek


More information about the systemd-devel mailing list