From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32171 invoked by alias); 3 May 2002 13:56:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 32157 invoked by uid 71); 3 May 2002 13:56:01 -0000 Date: Fri, 03 May 2002 06:56:00 -0000 Message-ID: <20020503135601.32156.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Joseph S. Myers" Subject: Re: c/6547: misleading printf '$' format Reply-To: "Joseph S. Myers" X-SW-Source: 2002-05/txt/msg00066.txt.bz2 List-Id: The following reply was made to PR c/6547; it has been noted by GNATS. From: "Joseph S. Myers" To: Cc: , , Subject: Re: c/6547: misleading printf '$' format Date: Fri, 3 May 2002 14:47:23 +0100 (BST) On 3 May 2002 peio@blutch.dyndns.org wrote: > With both v2.95 and 3.0, there is a warning on "%.*1$s": > "warning: unknown conversion type character '1' in format" > >How-To-Repeat: > #include > > int main (int argc, char *argv[]) { > printf("%.*s == %2$.*1$s\n", argc, *argv); You can't mix $ and non-$ formats in one format string; see the Single Unix Specification. Once a non-$ format is detected, $ operand numbers are no longer checked for. Note that "%." can only be the start of a non-$ format. -- Joseph S. Myers jsm28@cam.ac.uk