Hi.

On Fri, Oct 07, 2016 at 13:36:21 +0200, Christian Borntraeger wrote:
> On 10/07/2016 12:43 PM, Jiri Denemark wrote:
> > GCC on s390 complains
> > 
> > util/virconf.c: In function 'virConfGetValueSizeT':
> > util/virconf.c:1220:9: error: format '%zu' expects argument of type
> > 'size_t', but argument 9 has type 'unsigned int' [-Werror=format=]
> 
> Interesting, we have never seen this. is this 31bit (s390) or 64bit(s390x)?
> What gcc?

I finally got the time to get the additional info for you (which was not
exactly easy as it happened on a builder system):

$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ arch
s390

However, the host kernel is 2.6.32-573.22.1.el6.s390x. The build is done
on an s390x RHEL-6 host, but in a mocked s390 RHEL-7 environment :-)

> Can you maybe provide the virconf.i file to see how the SIZE_MAX define
> was resolved?

# 1199 "util/virconf.c"
int virConfGetValueSizeT(virConfPtr conf,
                         const char *setting,
                         size_t *value)
{
    virConfValuePtr cval = virConfGetValue(conf, setting);
    virLogMessage(&virLogSelf, VIR_LOG_DEBUG, "util/virconf.c", 1206,
        __func__, ((void *)0), "Get value size_t %p %d", cval,
        cval ? cval->type : VIR_CONF_NONE);
    if (!cval)
        return 0;
    if (cval->type != VIR_CONF_ULLONG) {
        virReportErrorHelper(VIR_FROM_CONF, VIR_ERR_INTERNAL_ERROR,
 "util/virconf.c"
# 1212 "util/virconf.c"
        , __FUNCTION__,
 1214
# 1212 "util/virconf.c"
        , dcgettext ("libvirt", "%s: expected an unsigned integer for
                      '%s' parameter", 5), conf->filename, setting)
                                               ;
        return -1;
    }
    if (((unsigned long long)cval->l) > (4294967295U)) {
        virReportErrorHelper(VIR_FROM_CONF, VIR_ERR_INTERNAL_ERROR,
 "util/virconf.c"
# 1220 "util/virconf.c"
        , __FUNCTION__,
 1222
# 1220 "util/virconf.c"
        , dcgettext ("libvirt", "%s: value for '%s' parameter must be
                      in range 0:%zu", 5), conf->filename, setting,
                      (4294967295U))
                                                         ;
        return -1;
    }
    *value = (size_t)cval->l;
    return 1;
}

Which means SIZE_MAX is 4294967295U.

Complete virconf.i can be seen at
http://people.redhat.com/~jdenemar/libvirt/virconf.i

Jirka

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to