From owner-freebsd-standards@FreeBSD.ORG Mon Apr 19 13:40:26 2004 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 64A3316A4CE for ; Mon, 19 Apr 2004 13:40:26 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B04243D1D for ; Mon, 19 Apr 2004 13:40:26 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i3JKeQbv073286 for ; Mon, 19 Apr 2004 13:40:26 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i3JKeQtP073285; Mon, 19 Apr 2004 13:40:26 -0700 (PDT) (envelope-from gnats) Date: Mon, 19 Apr 2004 13:40:26 -0700 (PDT) Message-Id: <200404192040.i3JKeQtP073285@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Wartan Hachaturow Subject: Re: standards/65779: Potential bug in printf positional parameters X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Wartan Hachaturow List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2004 20:40:26 -0000 The following reply was made to PR standards/65779; it has been noted by GNATS. From: Wartan Hachaturow To: freebsd-gnats-submit@FreeBSD.ORG Cc: Subject: Re: standards/65779: Potential bug in printf positional parameters Date: Tue, 20 Apr 2004 00:28:06 +0400 (sorry, misspelled gnats address in the last letter) On Mon, Apr 19, 2004 at 03:18:47PM -0400, Jonathan McGee wrote: > A minimum test case was written and attached (test-libc.c). When built, four > integers (1, 2, 3, 4) are passed to a positional printf that should display > them in order, skipping the second. This is not a bug. To quote SUSv3 (http://www.opengroup.org/onlinepubs/007904975/functions/fprintf.html): "When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string." Furthemore, man 3 printf says: "Arguments are numbered starting at 1. If unaccessed arguments in the format string are interspersed with ones that are accessed the results will be indeterminate." .. which is just what you get. -- Regards, Wartan. "Be different: conform."