This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Warn for dangerous use of omitted middle operand in ?:
- From: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- To: Andi Kleen <andi at firstfloor dot org>
- Cc: Paolo Carlini <paolo dot carlini at oracle dot com>, Jakub Jelinek <jakub at redhat dot com>, Richard Guenther <richard dot guenther at gmail dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 24 Jun 2010 14:52:10 +0200
- Subject: Re: [PATCH] Warn for dangerous use of omitted middle operand in ?:
- References: <20100531081916.GA20230@basil.fritz.box> <AANLkTim92f5e_fs1K2XgOIsH_zjwOMlAoeT7uRNuawMl@mail.gmail.com> <20100531124323.GB10766@basil.fritz.box> <20100531131516.GI10293@tyan-ft48-01.lab.bos.redhat.com> <20100531142050.GC10766@basil.fritz.box> <4C03C84F.2050005@oracle.com> <20100531154834.GD10766@basil.fritz.box> <20100603091818.GA5034@basil.fritz.box> <20100624112412.GE578@basil.fritz.box> <AANLkTil4aBHfbA5_V2DcEm-AL85fITacKmdEzD43eq1w@mail.gmail.com> <20100624122606.GI578@basil.fritz.box>
On 24 June 2010 14:26, Andi Kleen <andi@firstfloor.org> wrote:
> On Thu, Jun 24, 2010 at 01:50:59PM +0200, Manuel López-Ibáñez wrote:
>> On 24 June 2010 13:24, Andi Kleen <andi@firstfloor.org> wrote:
>> > On Thu, Jun 03, 2010 at 11:18:18AM +0200, Andi Kleen wrote:
>> >>
>> >> Ping, can someone commit this please?
>> >
>> > *ping^2*
>>
>> If the patch is approved, please rediff against a recent revision,
>> send it with the changelog (or provide me with a link to the
>> changelog) and I will commit it for you.
>
> Here's a rediffed patch.
> -Andi
>
> gcc/
> 2010-05-31 ?Andi Kleen ?<ak@linux.intel.com>
> ? ? ? ?* c-parser.c (c_parser_conditional_expression):
> ? ? ? ?Call warn_for_omitted_condop.
> ? ? ? ?* c-common.c (warn_for_omitted_condop): Add.
> ? ? ? ?* c-common.h (warn_for_omitted_condop): Add prototype.
c-family has its own Changelog.
> ? ? ? ?* cp/parser.cx: (cp_parser_question_colon_clause):
extra x
> --- /dev/null
> +++ b/gcc/testsuite/g++.dg/warn/warn-omitted-condop.C
> @@ -0,0 +1,58 @@
> +/* { dg-options "-Wparentheses" } */
This testcase has two times the same content (patch over existing file?)
> +++ b/gcc/testsuite/gcc.dg/warn-omitted-condop.c
> @@ -0,0 +1,58 @@
> +/* { dg-options "-Wparentheses" } */
> +
... and the C and C++ testcases are the same. So moving them to c-c++-common.
Committed revision 161318 with the above changes and the following
commit message:
2010-06-24 Andi Kleen <ak@linux.intel.com>
* c-parser.c (c_parser_conditional_expression):
Call warn_for_omitted_condop.
* doc/invoke.texi: Document omitted condop warning.
c-family/
* c-common.c (warn_for_omitted_condop): New.
* c-common.h (warn_for_omitted_condop): Add prototype.
testsuite/
* c-c++-common/warn-omitted-condop.c: New.
cp/
* parser.c: (cp_parser_question_colon_clause):
Switch to use cp_lexer_peek_token.
Call warn_for_omitted_condop. Call pedwarn for omitted
middle operand.