On Tue, Sep 09, 2014 at 01:38:13PM -0700, Joe Perches wrote: > Macros with flow control statements (goto and return) are > not very nice to read as any flow movement is unexpected. > > Try to highlight them and emit a warning on their definition. > > Avoid warning on macros that use argument concatenation as > those macros commonly create another function where the > concatenation is used in the function name definition like: > #define FOO_FUNC(name, rtn_type) \ > rtn_type func##name(arg1, ...) \ > { \ > rtn_type rtn; \ > [code...] \ > return rtn; \ > } > It adds 382 new warnings. The '##' trick doesn't remove all then macros which create functions. I can't think of a better way to do that though. We will eventually get rid of almost all the warnings in staging. The one that makes sense to keep is: drivers/staging/lustre/lnet/selftest/selftest.h:559 #define STATE2STR(x) case x: return #x My guess is that other maintainers won't be as excited to change these... Some of the macros have "RETURN", "RET" or "EXIT" in the name so the return is not really hidden. I'll attach the list of warning locations. regards, dan carpenter