]> xenbits.xensource.com Git - libvirt.git/commit
virConfGetValueSSizeT: Fix build on 32 bits
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 14 Jul 2016 21:37:56 +0000 (23:37 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 15 Jul 2016 03:58:42 +0000 (05:58 +0200)
commitb7caf4fcd2abca727a2325e0c66c2fb273b85642
tree06ecf3bc1c912dab40683b05ed0bf651206ed357
parentdae3b965604eff29ebacad2901ac856675e39de7
virConfGetValueSSizeT: Fix build on 32 bits

This function tries to get a ssize_t value from a config file.
But before returning it, it checks whether the value would fit in
ssize_t and if not an error is printed out among with the range
for the ssize_t type. However, on some platforms SSIZE_MAX may
actually be a signed long type:

util/virconf.c: In function 'virConfGetValueSSizeT':
util/virconf.c:1268:9: error: format '%zd' expects argument of type 'signed size_t', but argument 9 has type 'long int' [-Werror=format=]
         virReportError(VIR_ERR_INTERNAL_ERROR,
         ^
$ grep -r SSIZE_MAX /usr/include/
/usr/include/bits/posix1_lim.h:#ifndef  SSIZE_MAX
/usr/include/bits/posix1_lim.h:# define SSIZE_MAX       LONG_MAX

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virconf.c