[webkit-dev] Unused parameter warnings / errors / warning fixes
fpizlo at apple.com
Mon Jan 26 10:47:34 PST 2015
> On Jan 26, 2015, at 10:18 AM, Darin Adler <darin at apple.com> wrote:
> On Jan 26, 2015, at 10:11 AM, Filip Pizlo <fpizlo at apple.com> wrote:
>> So I actually do the opposite of pushing the configuration conditionals to the edges - I put them into the innards.
> Yes, this explains why the unused argument warnings are so frustrating for you!
Not just for me. And I don’t think it explains that at all. Platform and configuration conditionals imply that somewhere, there will have a method body that has #ifdefs that guard a call (or field access) to conditionalized code - otherwise that conditionalized code would never get called. I suspect we all try to minimize the total pain of #ifdefs. In some code, you get the smallest total pain by placing the #ifdefs on the edges; in other code it works best in the innards. There are many examples of the former. CPU guards are one example of the latter:
- Methods providing access to CPU features that are only available through inline assembly will be unconditionally declared but will have conditionalized innards.
- Most of the JIT treats hardware abstractly, and we try to isolate the places where CPU guards take effect. This means that the innards of methods that deal with things like calling convention will have conditionals.
I don’t mean to advocate the innards strategy as a general one - my point is that if your goal is to reduce total pain from #ifdefs and UNUSED_PARAMs then you will sometimes use the innards strategy.
> I don’t know what it says for the project as a whole.
More information about the webkit-dev