Il 13/06/2012 10:22, Laszlo Ersek ha scritto: > +static void > +opts_type_uint64(Visitor *v, uint64_t *obj, const char *name, Error **errp) > +{ > + OptsVisitor *ov = DO_UPCAST(OptsVisitor, visitor, v); > + const QemuOpt *opt; > + const char *str; > + > + opt = lookup_scalar(ov, name, errp); > + if (!opt) { > + return; > + } > + > + str = opt->str; > + if (str != NULL) { > + while (isspace((unsigned char)*str)) { > + ++str; > + } > + > + if (*str != '-' && *str != '\0') { > + unsigned long long val; > + char *endptr; > + > + /* non-empty, non-negative subject sequence */ > + errno = 0; > + val = strtoull(str, &endptr, 0); > + if (*endptr == '\0' && errno == 0 && val <= UINT64_MAX) {
I would have expected a warning from GCC here, but obviously that's not the case? Reviewed-by: Paolo Bonzini <pbonz...@redhat.com>