We have a bunch of new bug reports[1], detailing bugs of the form

   if ((rv = do_something(args) == APR_SUCCESS))

for

    if ((rv = do_something(args)) == APR_SUCCESS)

Of course, that's a C classic, and can be a *** to spot.

We can avoid this by adopting an alternative coding style
that doesn't rely on confusing parentheses:

  if (rv = do_something(args), rv == APR_SUCCESS)

Can I suggest adopting this as a guideline for new code,
to avoid this kind of bug?

[1] PR#40656 and 40658-40662

-- 
Nick Kew

Reply via email to