• Kir Kolyshkin's avatar
    netfilter.c: use literal string for printf format · f4577a00
    Kir Kolyshkin authored
    TL;DR: this allows to check if printf argument types are valid.
    
    Apparently, gcc is not able to check if the printf arguments
    are in sync with the format string, it a string is not a literal.
    This can be seen by compiling the code with -Wformat-nonliteral:
    
      CC       criu/netfilter.o
    criu/netfilter.c: In function ‘nf_connection_switch_raw’:
    criu/netfilter.c:80:4: error: format not a string literal, argument
    types not checked [-Werror=format-nonliteral]
        dip, (int)dst_port, sip, (int)src_port);
    
    Unfortunately we can't just add -Wformat-nonliteral to CFLAGS as there
    is at least one other place in the code what uses non-literal string
    as a format string for printf-like function. In this very case, though,
    there is no need to use a non-literal, so change it to a define.
    Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    f4577a00
Name
Last commit
Last update
Documentation Loading commit data...
contrib Loading commit data...
coredump Loading commit data...
crit Loading commit data...
criu Loading commit data...
images Loading commit data...
lib Loading commit data...
scripts Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
INSTALL.md Loading commit data...
Makefile Loading commit data...
Makefile.install Loading commit data...
Makefile.versions Loading commit data...
README.md Loading commit data...