From patchwork Thu Oct 13 23:19:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 119662 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id B01B3B71BF for ; Fri, 14 Oct 2011 10:21:34 +1100 (EST) Received: (qmail 18356 invoked by alias); 13 Oct 2011 23:21:29 -0000 Received: (qmail 18344 invoked by uid 22791); 13 Oct 2011 23:21:27 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com) (141.146.126.227) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 13 Oct 2011 23:21:12 +0000 Received: from ucsinet24.oracle.com (ucsinet24.oracle.com [156.151.31.67]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p9DNL81E007327 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 13 Oct 2011 23:21:10 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet24.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p9DNF8XT003886 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 13 Oct 2011 23:15:09 GMT Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p9DNL2Kh004845; Thu, 13 Oct 2011 18:21:02 -0500 Received: from [192.168.1.4] (/79.53.234.225) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 13 Oct 2011 16:21:02 -0700 Message-ID: <4E9771F9.2030803@oracle.com> Date: Fri, 14 Oct 2011 01:19:21 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Jason Merrill CC: "gcc-patches@gcc.gnu.org" Subject: Re: [C++ Patch] PR 17212 References: <4E96C49D.9080006@oracle.com> <4E96E2CE.9080907@redhat.com> <4E96F499.9090703@redhat.com> In-Reply-To: <4E96F499.9090703@redhat.com> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 10/13/2011 04:24 PM, Jason Merrill wrote: > On 10/13/2011 09:53 AM, Paolo Carlini wrote: >> Yes I briefly wondered that but I know *so* little about that front >> end... Do you think we can just add it? Probably yes ;) > Definitely. Anything supported in C++ should also be in Obj-C++ by > default. Ok, many thanks to Mike too for the additional clarifications. I tested on x86_64-linux the below. Ok for mainline? Thanks, Paolo. ////////////////////// /gcc 2011-10-13 Paolo Carlini PR c++/17212 * c-family/c.opt ([Wformat-zero-length]): Add C++ and Objective-C++. * doc/invoke.texi: Update. /testsuite 2011-10-13 Paolo Carlini PR c++/17212 * g++.dg/warn/format6.C: New. * obj-c++.dg/warn6.mm: Likewise. Index: doc/invoke.texi =================================================================== --- doc/invoke.texi (revision 179947) +++ doc/invoke.texi (working copy) @@ -3190,7 +3190,7 @@ in the case of @code{scanf} formats, this option w warning if the unused arguments are all pointers, since the Single Unix Specification says that such unused arguments are allowed. -@item -Wno-format-zero-length @r{(C and Objective-C only)} +@item -Wno-format-zero-length @r{(C, C++, Objective-C and Objective-C++ only)} @opindex Wno-format-zero-length @opindex Wformat-zero-length If @option{-Wformat} is specified, do not warn about zero-length formats. Index: c-family/c.opt =================================================================== --- c-family/c.opt (revision 179947) +++ c-family/c.opt (working copy) @@ -396,7 +396,7 @@ C ObjC C++ ObjC++ Var(warn_format_y2k) Warning Warn about strftime formats yielding 2-digit years Wformat-zero-length -C ObjC Var(warn_format_zero_length) Warning +C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning Warn about zero-length formats Wformat= Index: testsuite/g++.dg/warn/format6.C =================================================================== --- testsuite/g++.dg/warn/format6.C (revision 0) +++ testsuite/g++.dg/warn/format6.C (revision 0) @@ -0,0 +1,7 @@ +// PR c++/17212 +// { dg-options "-Wformat -Wno-format-zero-length" } + +void f() +{ + __builtin_printf(""); +} Index: testsuite/obj-c++.dg/warn6.mm =================================================================== --- testsuite/obj-c++.dg/warn6.mm (revision 0) +++ testsuite/obj-c++.dg/warn6.mm (revision 0) @@ -0,0 +1,7 @@ +// PR c++/17212 +// { dg-options "-Wformat -Wno-format-zero-length" } + +void f() +{ + __builtin_printf(""); +}