[cfe-commits] [PATCH] Unused function warning

Devang Patel devang.patel at gmail.com
Fri Jan 29 17:07:30 PST 2010


> There are two more cases to think about. First, we shouldn't warn about inline static functions. Second, we should figure out what using one of these static functions as an unevaluated operand should silence the warning. For example:
>
>  static int f0() { return 17; }
>  int x = sizeof(f0());
>
> The "used" bit on f0 won't get set, so I'm guessing we'll end up warning about "f0" being unused. The list-of-unused-static-functions approach I mentioned above could avoid this problem, if we don't want the warning there. I don't really have a strong opinion on the matter.

Should this flag warn about functions decorated with __attribute((used)) ?
-
Devang




More information about the cfe-commits mailing list