This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C PATCH] Reject #pragma omp for for (unsigned int i = 10; i != 0; i--) (PR c/39495)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]