From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14454 invoked by alias); 3 May 2002 14:26:01 -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 14405 invoked by uid 71); 3 May 2002 14:26:01 -0000 Date: Fri, 03 May 2002 07:26:00 -0000 Message-ID: <20020503142601.14399.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Pierre-Canalsat PETIT" Subject: Re: c/6547: misleading printf '$' format Reply-To: "Pierre-Canalsat PETIT" X-SW-Source: 2002-05/txt/msg00067.txt.bz2 List-Id: The following reply was made to PR c/6547; it has been noted by GNATS. From: "Pierre-Canalsat PETIT" To: jsm28@cam.ac.uk Cc: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, Joseph Myers , peio@blutch.dyndns.org, prpetit@canal-plus.com Subject: Re: c/6547: misleading printf '$' format Date: Fri, 3 May 2002 16:18:13 +0200 > 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. ====(forgot to answer to all...)==== True.. I forgot that, thanks. So gcc-3.0 has no misleading warning, good point (maybe a more verbose warning should be written..). Note v2.95.4 still has one : #include int main(int argc, char *argv[]) { printf("%2$.*1$s\n", argc, *argv); return 0; } This gives a "warning: unknown conversion type character '1' in format" ====(Snap)==== There is still a problem it seems on gcc v3.0.4.. : #include #include int main(int argc, char *argv[]) { printf("Usage: %1$s [-n