1. 08 Sep, 2016 2 commits
    • 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
    • Kir Kolyshkin's avatar
      Makefile: add -Wformat-security to CFLAGS · 00d48810
      Kir Kolyshkin authored
      Apparently when travis checks patches, it compiles code with
      -Wformat-security (most probably because the distro/gcc it uses
      has it on by default), but on my system (Fedora 24/gcc 6.1.1)
      this flag is not on. As a result, code compiles fine for me
      but travis reports an error.
      
      Add -Wformat-security to default CFLAGS. It helps to catch
      problems like using printf(str) instead of printf("%s", str).
      Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      00d48810
  2. 07 Sep, 2016 2 commits
  3. 06 Sep, 2016 36 commits