1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-02-27 19:05:02 -06:00
Simon Tatham 41053e9dcd GTK: fix control flow in do_cmdline().
In commit 4ecc3f3c09 I did a knee-jerk fix of a macro of the form

  #define SECOND_PASS_ONLY { body; }

on the grounds that it was syntax-unsafe, so I wrapped it in the
standard do while(0):

  #define SECOND_PASS_ONLY do { body; } while (0)

But in this case, that was a bogus transformation, because the body
executed 'continue' with the intention of affecting the containing
loop (outside the macro). Moreover, ten lines above the macro
definition was a comment specifically explaining why it _couldn't_ be
wrapped in do while (0) !

Since then I've come up with an alternative break-and-continue-proof
wrapper for macros that are supposed to expand to something that's
syntactically a C statement. So I've used that instead, and while I'm
at it, fixed the neighbouring EXPECTS_ARG as well.

Spotted by Coverity, and well spotted indeed! How embarrassing.
2020-06-21 16:39:47 +01:00
..
2020-02-09 08:51:37 +00:00
2019-03-31 10:35:10 +01:00
2019-10-14 19:42:37 +01:00
2020-06-21 16:39:47 +01:00
2020-02-09 08:51:37 +00:00
2020-02-09 08:51:37 +00:00
2019-10-14 19:42:37 +01:00
2020-06-14 15:49:36 +01:00
2020-06-21 16:39:47 +01:00
2019-10-14 19:42:37 +01:00
2020-02-09 08:51:37 +00:00