From: "Manuel López-Ibáñez" <lopezibanez@gmail.com>
To: Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
Cc: "Joseph S. Myers" <joseph@codesourcery.com>,
Gcc Patch List <gcc-patches@gcc.gnu.org>
Subject: Re: -Wvariadic-macros does not print warning
Date: Tue, 29 Apr 2014 13:21:00 -0000 [thread overview]
Message-ID: <CAESRpQBkX=M1oxVEHiy7GqG2KoQ-o5Ou4kUvJezK+z70hEP7Pg@mail.gmail.com> (raw)
In-Reply-To: <CAJXstsDq2O-aVnOymG=3AAAWu5gnKSn-Yavn49wx5=Hj6y=MTw@mail.gmail.com>
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=format
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
===================================================================
--- 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 <bilbotheelffriend@gmail.com> wrote:
> On Tue, Apr 29, 2014 at 2:07 PM, Manuel López-Ibáñez
> <lopezibanez@gmail.com> wrote:
>> On 23 April 2014 20:03, Prathamesh Kulkarni <bilbotheelffriend@gmail.com> 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/msg00096.html
>>> I have attached patch that prints the warning when passed -Wvariadic-macros
>>> (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 runinng
> libcpp tests (RUNTESTFLAGS=cpp.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.
next prev parent reply other threads:[~2014-04-29 13:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAJXstsDGN7XDYBjFvgCsV-nAceMZNMB+2snrEcfH0jcNNLev5g@mail.gmail.com>
2014-04-23 18:01 ` Prathamesh Kulkarni
2014-04-23 18:06 ` Prathamesh Kulkarni
2014-04-29 8:46 ` Manuel López-Ibáñez
2014-04-29 12:42 ` Prathamesh Kulkarni
2014-04-29 13:21 ` Manuel López-Ibáñez [this message]
2014-04-29 14:14 ` Prathamesh Kulkarni
2014-04-29 14:29 ` Prathamesh Kulkarni
2014-05-09 19:33 ` Jeff Law
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAESRpQBkX=M1oxVEHiy7GqG2KoQ-o5Ou4kUvJezK+z70hEP7Pg@mail.gmail.com' \
--to=lopezibanez@gmail.com \
--cc=bilbotheelffriend@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=joseph@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).