Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Sep 2007 20:24:01 -0500 (CDT)
From:      "Sean C. Farley" <scf@FreeBSD.org>
To:        freebsd-standards@FreeBSD.org
Cc:        Xin LI <delphij@FreeBSD.org>, "Sean C. Farley" <scf@FreeBSD.org>
Subject:   vfprintf() string precision type
Message-ID:  <alpine.BSF.0.9999.0709161922560.29967@thor.farley.org>

next in thread | raw e-mail | index | archive | help
Xin LI noticed a warning in the code I wrote for setenv() where a
precision was provided with a string argument to warnx() (really
vfprintf()).  The warning appearing on amd64 and not i386 showed that
precisions are always 32-bit.

Would it be better to change the precision handling to expect size_t?
My reasoning is that strlen() and sizeof both return size_t.  It makes a
cast unnecessary for passing a value returned by either call as the
precision.  Unfortunately, I could find nothing from SUSv3 that
specified what type the precision could be.

Sean

P.S. I am not on this list; please keep the Cc.
-- 
scf@FreeBSD.org



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