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: Patch [3.4/3.3] G++ eliminate use of conditional expressions as lvalues


Patch fixes:

> 11 ISO C forbids use of conditional expressions as lvalues

`current_binding_level' contains a ?:, so it can't be used as an
lvalue.  I wrote a macro `set_current_binding_level' to use instead.
No real functional change.

I think that is overkill.  All you need to do is apply the
distributive law to the * and ?: operators:

#define current_binding_level                   \
  (*(cfun && cp_function_chain->bindings        \
     ? &cp_function_chain->bindings             \  
     : &scope_chain->bindings))

-- 
--------------------------
SuperH (UK) Ltd.
2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX
T:+44 1454 465658


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