LWN.net Logo

_must_check

_must_check

Posted Dec 2, 2006 22:02 UTC (Sat) by jzbiciak (✭ supporter ✭, #5246)
In reply to: _must_check by ldo
Parent article: KHB: Automating bug hunting

(void)strcpy(buf, "That's just plain silly.\n");

for (i = 0; i < 100; (void)i++)
    (void)printf("%s", buf);

(void)fflush(stdout);


I think if you required (void) casts on all ignored return values, you'd quickly find yourself adding them blindly, and/or probably going (void)just this (void)side of (void)insane. (void)(void)(VOID)


(Log in to post comments)

_must_check

Posted Dec 2, 2006 22:03 UTC (Sat) by jzbiciak (✭ supporter ✭, #5246) [Link]

Oh, and imagine requiring that for C++. Recall that operator= returns the assigned value.... (void)a = b; Ok, maybe that's a bit over-the-top, but really, where do you draw the line?

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds