Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jun 2009 15:25:19 +0200
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        Stanislav Sedov <stas@freebsd.org>, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Benno Rice <benno@freebsd.org>
Subject:   Re: svn commit: r193475 - head/sbin/kldload
Message-ID:  <20090605132519.GA4091@stack.nl>
In-Reply-To: <20090605182104.S15688@delplex.bde.org>
References:  <200906042343.n54Nh8c5008164@svn.freebsd.org> <20090605102431.4769115f.stas@FreeBSD.org> <20090605182104.S15688@delplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 05, 2009 at 06:52:07PM +1000, Bruce Evans wrote:
> Well, %z might be wrong since only the pathlen variable is of type size_t.
> The expression `pathlen + 1' has type:

>  	__binarypromoteof(__typeof(pathlen), int)),

> so if size_t is smaller than int then the promotions are non-null and give
> a type larger than size_t, and %z is wrong.  To use %z, the expression
> should be written as (size_t)(pathlen + 1).

The promotion is not a problem because it would happen anyway, as it is
an unprototyped parameter. printf and the like know this.

-- 
Jilles Tjoelker



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090605132519.GA4091>