This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR c/17880 -Wsequence-point doesn't warn inside if, while, do conditions, for beg/cond/end expressions etc.
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 9 Aug 2008 12:06:25 +0000 (UTC)
- Subject: Re: PR c/17880 -Wsequence-point doesn't warn inside if, while, do conditions, for beg/cond/end expressions etc.
- References: <6c33472e0808090235n52942a48tbc9c8021e71a032a@mail.gmail.com>
On Sat, 9 Aug 2008, Manuel López-Ibáñez wrote:
> Fixed by calling verify_sequence_points at the appropriate places.
>
> Bootstrapped and regression tested on x86_64-unknown-linux-gnu with
> --enable-languages=all.
>
> OK for trunk?
>
> 2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
>
> PR c/17880
> * c-typeck.c (digest_init): Call verify_sequence_points from here.
> (c_finish_return): Likewise.
> (c_start_case): Likewise.
> * c-common.c (warn_for_collisions_1): Use explicit location in
> warning.
> * c-parser.c (c_parser_condition): New. Call
> verify_sequence_points.
> (c_parser_paren_condition): Call c_parser_condition.
> (c_parser_for_statement): Call c_parser_condition.
> testsuite/
> * gcc.dg/sequence-pt-pr17880.c: New.
OK. If any part of this issue also applies to C++ please make sure
there's a separate PR open for C++ before closing that one.
--
Joseph S. Myers
joseph@codesourcery.com