[C2hs] patch applied (c2hs): GNU C allows comitting the middle expr in conditional expressions

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Sun Mar 25 22:04:16 EDT 2007


Sun Mar 25 05:50:51 PDT 2007  Duncan Coutts <duncan.coutts at worc.ox.ac.uk>
  * GNU C allows comitting the middle expr in conditional expressions
  so normally it's:
   <condition-exp> ? <then-exp> : <else-exp>
  and GNU allows:
    <condition-exp> ? : <else-exp>
  which in the 'then' case evaluates to <condition-exp>.
  The advantage here is that the condition exp is evaluated only once.

    M ./c2hs/c/CAST.hs -1 +1
    M ./c2hs/c/CNames.hs -1 +1
    M ./c2hs/c/CParser.y -1 +7


More information about the C2hs mailing list