From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23859 invoked by alias); 29 Apr 2014 13:20:09 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 23847 invoked by uid 89); 29 Apr 2014 13:20:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f47.google.com Received: from mail-wg0-f47.google.com (HELO mail-wg0-f47.google.com) (74.125.82.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 29 Apr 2014 13:20:07 +0000 Received: by mail-wg0-f47.google.com with SMTP id n12so196626wgh.18 for ; Tue, 29 Apr 2014 06:20:04 -0700 (PDT) X-Received: by 10.180.14.233 with SMTP id s9mr131945wic.53.1398777604213; Tue, 29 Apr 2014 06:20:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.89.4 with HTTP; Tue, 29 Apr 2014 06:19:44 -0700 (PDT) In-Reply-To: References: From: =?ISO-8859-1?Q?Manuel_L=F3pez=2DIb=E1=F1ez?= Date: Tue, 29 Apr 2014 13:21:00 -0000 Message-ID: Subject: Re: -Wvariadic-macros does not print warning To: Prathamesh Kulkarni Cc: "Joseph S. Myers" , Gcc Patch List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2014-04/txt/msg01971.txt.bz2 This hunk in your patch doesn't seem related: @@ -509,6 +509,9 @@ Warn about missing fields in struct init Wsizeof-pointer-memaccess C ObjC C++ ObjC++ Var(warn_sizeof_pointer_memaccess) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall) +Wsizeof-array-argument +C Var(warn_sizeof_array_argument) Warning LangEnabledBy(C,Wall) + Wsuggest-attribute=3Dformat C ObjC C++ ObjC++ Var(warn_suggest_attribute_format) Warning Warn about functions which might be candidates for format attributes Also, it would be good to update doc/invoke.texi, the current description is a bit confusing. It says it is enabled by default when it actually isn't (nor after your patch). I propose something like: Index: gcc/doc/invoke.texi =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc/doc/invoke.texi (revision 208669) +++ gcc/doc/invoke.texi (working copy) @@ -4997,9 +4997,10 @@ @item -Wvariadic-macros @opindex Wvariadic-macros @opindex Wno-variadic-macros -Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU -alternate syntax when in pedantic ISO C99 mode. This is default. -To inhibit the warning messages, use @option{-Wno-variadic-macros}. +Warn if variadic macros are used in ISO C90 mode, or if the GNU +alternate syntax is used in ISO C99 mode. This is enabled by either +@option{-Wpedantic} or @option{-Wtraditional}. To inhibit the warning +messages, use @option{-Wno-variadic-macros}. @item -Wvarargs @opindex Wvarargs On 29 April 2014 14:41, Prathamesh Kulkarni w= rote: > On Tue, Apr 29, 2014 at 2:07 PM, Manuel L=F3pez-Ib=E1=F1ez > wrote: >> On 23 April 2014 20:03, Prathamesh Kulkarni wrote: >>> I didn't attach the patch, I am extremely sorry for the noise. >>> I am re-posting the mail. >>> This is a follow up mail to http://gcc.gnu.org/ml/gcc-help/2014-04/msg0= 0096.html >>> I have attached patch that prints the warning when passed -Wvariadic-ma= cros >>> (I mostly followed it along lines of -Wlong-long). >>> OK for trunk ? >> >> Hi Prathamesh, >> >> Thanks for CCing me! I cannot approve patches, but it looks almost >> perfect to me. Did you run the regression testsuite and compare the >> results before/after your patch? I would expect at least one testcase >> testing this warning that would be affected by the change. If not, it >> would be nice to add testcases for this. Also, there is another place >> that tests for both Wpedantic and Wvariadic-macros just above the one >> that you modify. I think you should update all of them to just test >> for Wvariadic-macros. >> >> Once you do that, I hope Joseph will approve it quickly, it seems an >> obvious fix to me for consistency with Wlong-long and to allow people >> to use this warning without enabling Wpedantic (also, it will enable >> the warning with Wtraditional as intended, which is currently broken). >> > Thanks, I modified the patch to remove Wpedantic check and added a new > test-case. > For changes to libcpp, do I need to run the entire test-suite or only run= inng > libcpp tests (RUNTESTFLAGS=3Dcpp.exp) is fine ? > I ran libcpp tests, and there appeared to be no failures. > > [libcpp] > * macro.c (parse_params): Remove check for Wpedantic for variadic macros. > > [gcc/c-family] > * c.opt (-Wvariadic-macros): Init(-1) instead of Init(1). > * c-opts.c (c_common_handle_option): Add case OPT_Wvariadic_macros. > (sanitize_cpp_opts): Check condition for pedantic or > warn_traditional. > > [gcc/testsuite/gcc.dg/cpp] > * Wvariadic-5.c: New test-case. > > Thanks and Regards, > Prathamesh > >> Cheers, >> >> Manuel.