T
Tom St Denis
I think he decided "inline" is bad and is now trying to justify it.
Most of his arguments against inline apply to macros.
Pros for functions:
- More traditional look that makes them easier to read
Cons for functions:
- Code bloat (*)
- Affects compile time
- Prevents trivial asm mappings (for when performance matters most)
Pros for macros:
- Doesn't affect compile time
- No bloat [not compiled when not used]
- Allows for trivial asm mappings (variables are local)
Cons for macros:
- Can be harder to read
- Not all functions map well to macros (multi-stmt with return
values...)
(*) Yes, GCC won't include static functions that are not called, but
not all compilers do this, nor is it required by the standard.
So no, I'm not just trying to justify my comments with things that
equally apply to both.
And all people have shown me so far are 1 stmt inlined functions which
could just as easily been done as macros. And nobody has yet been
able to argue they're even needed for performance reasons...
Tom