This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/2] Fix new -Wparentheses warnings encountered during bootstrap
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Patrick Palka <patrick at parcs dot ath dot cx>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org, jason at redhat dot com
- Date: Thu, 31 Mar 2016 23:30:31 +0200
- Subject: Re: [PATCH 1/2] Fix new -Wparentheses warnings encountered during bootstrap
- Authentication-results: sourceware.org; auth=none
- References: <1459457625-20610-1-git-send-email-patrick at parcs dot ath dot cx>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Mar 31, 2016 at 04:53:45PM -0400, Patrick Palka wrote:
> @@ -2526,12 +2526,13 @@ struct GTY(()) lang_decl {
>
> */
> #define FOR_EACH_CLONE(CLONE, FN) \
> - if (TREE_CODE (FN) == FUNCTION_DECL \
> - && (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (FN) \
> - || DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (FN))) \
> - for (CLONE = DECL_CHAIN (FN); \
> - CLONE && DECL_CLONED_FUNCTION_P (CLONE); \
> - CLONE = DECL_CHAIN (CLONE))
> + if (!(TREE_CODE (FN) == FUNCTION_DECL \
> + && (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (FN) \
> + || DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (FN))))\
> + ; \
> + else for (CLONE = DECL_CHAIN (FN); \
> + CLONE && DECL_CLONED_FUNCTION_P (CLONE); \
> + CLONE = DECL_CHAIN (CLONE))
Can you please do
+ else \
+ for (CLONE = DECL_CHAIN (FN); \
...
instead?
> --- a/gcc/testsuite/g++.dg/plugin/pragma_plugin.c
> +++ b/gcc/testsuite/g++.dg/plugin/pragma_plugin.c
> @@ -32,14 +32,16 @@ handle_pragma_sayhello (cpp_reader *dummy)
> return;
> }
> if (TREE_STRING_LENGTH (message) > 1)
> - if (cfun)
> - warning (OPT_Wpragmas,
> - "%<pragma GCCPLUGIN sayhello%> from function %qE: %s",
> - cfun->decl, TREE_STRING_POINTER (message));
> + {
> + if (cfun)
> + warning (OPT_Wpragmas,
> + "%<pragma GCCPLUGIN sayhello%> from function %qE: %s",
> + cfun->decl, TREE_STRING_POINTER (message));
> else
> - warning (OPT_Wpragmas,
> + warning (OPT_Wpragmas,
> "%<pragma GCCPLUGIN sayhello%> outside of function: %s",
> TREE_STRING_POINTER (message));
> + }
Several lines with 8 spaces instead of tab above. Can you also indent
the last warning's following lines to be below OPT_?
Otherwise LGTM.
Jakub