generator: Don't print variable unless the generator returned a value
authorJon Griffiths <jon_p_griffiths@yahoo.com>
Mon, 22 Aug 2016 14:39:38 +0000 (02:39 +1200)
committerJon Griffiths <jon_p_griffiths@yahoo.com>
Mon, 29 Aug 2016 04:54:58 +0000 (16:54 +1200)
commit2b54b296f064c14287a7585535aa4b097cf89a6a
treec17fd3cdebd0b53c5a4bd90c1dd6771345ae6006
parent03f100b281441a953d4ec858389f82e25a95c043
generator: Don't print variable unless the generator returned a value

clang warns that the generator assignment is conditional which could
lead to passing an undefined variable to printf.

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
ccan/generator/test/compile_fail-4.c