]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lscpu: fix possibly undefined operation
authorPetr Uzel <petr.uzel@suse.cz>
Mon, 23 Apr 2012 08:43:38 +0000 (10:43 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 23 Apr 2012 12:05:29 +0000 (14:05 +0200)
commit14e8be8ab3db2d782484af9363d6adc351b95a0b
tree4e94da9deb35f3084114662f833a447d5a412b98
parent4f83dcceba66278378c5e759e56b4d48368bb796
lscpu: fix possibly undefined operation

With -Wall -Werror, compilation of lscpu.c fails with:

  Making all in sys-utils
  make[2]: Entering directory `/home/petr/upstream/util-linux/sys-utils'
  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -include ../config.h -I../include -DLOCALEDIR=\"/usr/share/locale\"  -fsigned-char -Wall -Werror -MT lscpu.o -MD -MP -MF .deps/lscpu.Tpo -c -o lscpu.o lscpu.c
  lscpu.c: In function ‘print_parsable’:
  lscpu.c:971:7: error: operation on ‘p’ may be undefined [-Werror=sequence-point]
  cc1: all warnings being treated as errors

Fix by splitting the pointer increment to separate statement.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
sys-utils/lscpu.c