From owner-freebsd-bugs Sun Oct 12 16:50:04 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA28744 for bugs-outgoing; Sun, 12 Oct 1997 16:50:04 -0700 (PDT) (envelope-from owner-freebsd-bugs) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA28737; Sun, 12 Oct 1997 16:50:02 -0700 (PDT) (envelope-from gnats) Resent-Date: Sun, 12 Oct 1997 16:50:02 -0700 (PDT) Resent-Message-Id: <199710122350.QAA28737@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, eserte@cs.tu-berlin.de Received: from cottrell.dialup.fu-berlin.de (anonymous220.ppp.cs.tu-berlin.de [130.149.17.220]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id QAA28358 for ; Sun, 12 Oct 1997 16:41:40 -0700 (PDT) (envelope-from eserte@cottrell.dialup.fu-berlin.de) Received: (from eserte@localhost) by cottrell.dialup.fu-berlin.de (8.8.5/8.8.5) id BAA00623; Mon, 13 Oct 1997 01:39:05 +0200 (CEST) Message-Id: <199710122339.BAA00623@cottrell.dialup.fu-berlin.de> Date: Mon, 13 Oct 1997 01:39:05 +0200 (CEST) From: Slaven Rezic Reply-To: eserte@cs.tu-berlin.de To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: gnu/4748: cc -Wformat too sensitive Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 4748 >Category: gnu >Synopsis: cc -Wformat too sensitive >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Oct 12 16:50:01 PDT 1997 >Last-Modified: >Originator: Slaven Rezic >Organization: Private FreeBSD site, Berlin, Germany >Release: FreeBSD 2.2.1-RELEASE i386 >Environment: >Description: cc -Wformat warns about "flag `0' used with type `s'". But due to the manpage, this is correct and produces the expected code, too. >How-To-Repeat: Try this code with "cc -Wformat foo.c": #include main() { printf("%08s\n", "12"); } >Fix: The following patch should fix the problem (not tested). Patch against file in /usr/src/contrib/gcc. --- c-common.c.orig Mon Oct 13 01:33:18 1997 +++ c-common.c Mon Oct 13 01:34:06 1997 @@ -705,7 +705,7 @@ { "feEgG", 0, T_D, NULL, NULL, NULL, T_LD, "-wp0 +#" }, { "c", 0, T_I, NULL, T_W, NULL, NULL, "-w" }, { "C", 0, T_W, NULL, NULL, NULL, NULL, "-w" }, - { "s", 1, T_C, NULL, T_W, NULL, NULL, "-wp" }, + { "s", 1, T_C, NULL, T_W, NULL, NULL, "-wp0" }, { "S", 1, T_W, NULL, NULL, NULL, NULL, "-wp" }, { "p", 1, T_V, NULL, NULL, NULL, NULL, "-w" }, { "n", 1, T_I, T_S, T_L, T_LL, NULL, "" }, >Audit-Trail: >Unformatted: