From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Seo9E-00048z-5m for qemu-devel@nongnu.org; Wed, 13 Jun 2012 10:02:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Seo9C-0001wz-B1 for qemu-devel@nongnu.org; Wed, 13 Jun 2012 10:02:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Seo9C-0001uY-2z for qemu-devel@nongnu.org; Wed, 13 Jun 2012 10:02:10 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5DE28BI015701 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 13 Jun 2012 10:02:08 -0400 Message-ID: <4FD89DA3.7040002@redhat.com> Date: Wed, 13 Jun 2012 16:03:15 +0200 From: Laszlo Ersek MIME-Version: 1.0 References: <1339575768-2557-1-git-send-email-lersek@redhat.com> <1339575768-2557-6-git-send-email-lersek@redhat.com> <4FD8705C.2010503@redhat.com> In-Reply-To: <4FD8705C.2010503@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 05/17] qapi: introduce OptsVisitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On 06/13/12 12:50, Paolo Bonzini wrote: > 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? Right, same surprise here. Maybe gcc has seen the light and it realizes now "long long" can be wider than 64 bits, theoretically. Thanks for the review! Laszlo