From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6439 invoked by alias); 23 Apr 2012 20:22:44 -0000 Received: (qmail 6429 invoked by uid 22791); 23 Apr 2012 20:22:43 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 Apr 2012 20:22:31 +0000 From: "andersk at mit dot edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/47901] -Wall should not imply -Wformat-zero-length by default Date: Mon, 23 Apr 2012 20:22:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: andersk at mit dot edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg02017.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D47901 --- Comment #5 from Anders Kaseorg 2012-04-23 20:2= 2:20 UTC --- I=E2=80=99m not sure ("%s", "") is a suitable replacement in general. Mayb= e this is a far-fetched example, but what the purpose of custom_printf is to shell-quote all its arguments, so that custom_printf(foo, "") writes "some_command" wit= h no arguments but custom_printf(foo, "%s", "") writes "some_command ''" with a single empty argument? In any event, ("%s", "") is certainly different code with a potential runti= me cost, and it=E2=80=99s not fair for -Wall to complain about the more straig= htforward ("") unless it=E2=80=99s reasonably likely for that code to be hiding some = class of bugs. Is it? (Another real-world example from a project I help maintain: https://github.com/barnowl/barnowl/blob/barnowl-1.8.1/keys.c#L337 )