From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 23:20:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BBD51065690; Sun, 13 Nov 2011 23:20:55 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pz0-f44.google.com (mail-pz0-f44.google.com [209.85.210.44]) by mx1.freebsd.org (Postfix) with ESMTP id F00518FC13; Sun, 13 Nov 2011 23:20:54 +0000 (UTC) Received: by pzk33 with SMTP id 33so21959612pzk.3 for ; Sun, 13 Nov 2011 15:20:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=CTUo3LOxDv+/lCRpkPZ2mABkar/vdA6uTfkdeJi+HEE=; b=RECKfmPM0xY6Ivdai5lm7cdKm6PXR56Gkj4rNB6Jov1+fAZbSbsRQd6Ta/uwfxUXNE yWfNdQbt1XD3T9LDWMD3jRqWaX9/U8Hnda/QvJSxYDLXcjOfyOUv8MWlxq68IHUkbrnD j4YsAcrOCI1XNiqYKy4YOOk20npKZQ0y5kDuk= MIME-Version: 1.0 Received: by 10.68.27.166 with SMTP id u6mr44332803pbg.59.1321225029628; Sun, 13 Nov 2011 14:57:09 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.56.97 with HTTP; Sun, 13 Nov 2011 14:57:09 -0800 (PST) In-Reply-To: References: <201111122001.pACK1UML059238@svn.freebsd.org> <20111113220817.GC1677@garage.freebsd.pl> Date: Sun, 13 Nov 2011 14:57:09 -0800 X-Google-Sender-Auth: OejJTDKKnAYD1w85Q5siyHo2EWA Message-ID: From: mdf@FreeBSD.org To: Garrett Cooper Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org Subject: Re: svn commit: r227473 - head/sbin/geom/class/multipath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 23:20:55 -0000 On Sun, Nov 13, 2011 at 2:46 PM, Garrett Cooper wrote: > On Sun, Nov 13, 2011 at 2:08 PM, Pawel Jakub Dawidek wr= ote: >> On Sat, Nov 12, 2011 at 12:16:23PM -0800, Garrett Cooper wrote: >>> On Sat, Nov 12, 2011 at 12:01 PM, Alexander Motin wro= te: >>> > Author: mav >>> > Date: Sat Nov 12 20:01:30 2011 >>> > New Revision: 227473 >>> > URL: http://svn.freebsd.org/changeset/base/227473 >>> > >>> > Log: >>> > =A0Fix build on some archs after r227464. >>> > >>> > Modified: >>> > =A0head/sbin/geom/class/multipath/geom_multipath.c >>> > >>> > Modified: head/sbin/geom/class/multipath/geom_multipath.c >>> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> > --- head/sbin/geom/class/multipath/geom_multipath.c =A0 =A0 Sat Nov 1= 2 19:55:48 2011 =A0 =A0 =A0 =A0(r227472) >>> > +++ head/sbin/geom/class/multipath/geom_multipath.c =A0 =A0 Sat Nov 1= 2 20:01:30 2011 =A0 =A0 =A0 =A0(r227473) >>> > @@ -133,7 +133,8 @@ mp_label(struct gctl_req *req) >>> > =A0 =A0 =A0 =A0uint8_t *sector, *rsector; >>> > =A0 =A0 =A0 =A0char *ptr; >>> > =A0 =A0 =A0 =A0uuid_t uuid; >>> > - =A0 =A0 =A0 uint32_t secsize =3D 0, ssize, status; >>> > + =A0 =A0 =A0 ssize_t secsize =3D 0, ssize; >>> > + =A0 =A0 =A0 uint32_t status; >>> > =A0 =A0 =A0 =A0const char *name, *name2, *mpname; >>> > =A0 =A0 =A0 =A0int error, i, nargs, fd; >>> > >>> > @@ -161,8 +162,8 @@ mp_label(struct gctl_req *req) >>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0disksize =3D msize; >>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else { >>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (secsize !=3D ssize= ) { >>> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gctl_er= ror(req, "%s sector size %u different.", >>> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= name, ssize); >>> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gctl_er= ror(req, "%s sector size %ju different.", >>> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= name, (intmax_t)ssize); >>> >>> Shouldn't that be uintmax_t, not intmax_t ? >> >> No, ssize_t is signed. Although the best would be to use %zd for >> ssize_t. > > Thanks... Missed the leading s. ... except that the cast and conversion specifier aren't in sync. The cast is signed; the conversion specifier is unsigned. %zd is still best, since it's the conversion specifier for the variable's type. Next best is %jd and cast to intmax_t, since the signedness is preserved. But in the end it doesn't matter a lot since whatever is printed in the error message, it's likely derivable from reading the code what the actual value used was. Cheers, matthew