From owner-freebsd-standards@FreeBSD.ORG Mon Sep 17 01:39:04 2007 Return-Path: Delivered-To: freebsd-standards@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0A1B16A419 for ; Mon, 17 Sep 2007 01:39:04 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (farley.org [67.64.95.201]) by mx1.freebsd.org (Postfix) with ESMTP id 55D7813C46B for ; Mon, 17 Sep 2007 01:39:04 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from thor.farley.org (thor.farley.org [192.168.1.5]) by mail.farley.org (8.14.1/8.14.1) with ESMTP id l8H1O1OQ000826; Sun, 16 Sep 2007 20:24:01 -0500 (CDT) (envelope-from scf@FreeBSD.org) Date: Sun, 16 Sep 2007 20:24:01 -0500 (CDT) From: "Sean C. Farley" To: freebsd-standards@FreeBSD.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on mail.farley.org Cc: Xin LI , "Sean C. Farley" Subject: vfprintf() string precision type X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2007 01:39:04 -0000 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