This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C PATCH] Reject #pragma omp for for (unsigned int i = 10; i != 0; i--) (PR c/39495)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 20 Mar 2009 20:34:25 +0000 (UTC)
- Subject: Re: [C PATCH] Reject #pragma omp for for (unsigned int i = 10; i != 0; i--) (PR c/39495)
- References: <20090320153627.GO4831@tyan-ft48-01.lab.bos.redhat.com>
On Fri, 20 Mar 2009, Jakub Jelinek wrote:
> 2009-03-20 Jakub Jelinek <jakub@redhat.com>
>
> PR c/39495
> * c-parser.c (c_parser_binary_expression): Add first argument, use it
> instead of initial c_parser_cast_expression call if non-NULL.
> (c_parser_conditional_expression): Adjust caller.
> (c_parser_omp_for_loop): Ensure the condition is only <, <=, >, >=.
The first binary operator found is not necessarily the toplevel one in the
binary expression; e.g. you could have a < 10 != 0 which parses as ((a <
10) != 0), but maybe you handle that case elsewhere. If you really do
need literally the first binary operator in the expression this is OK; if
the toplevel one is sufficient you should be able to get it from the
original_code member of c_parser_binary_expression's return value.
--
Joseph S. Myers
joseph@codesourcery.com