4 ms·
A C header can contain function definitions, though - either using the inline keyword (since C99) or as macros. Moving all functionality behind a function call
by scatters 6y ago
A C header can contain function definitions, though - either using the inline keyword (since C99) or as macros. Moving all functionality behind a function call barrier may not give satisfactory performance.
- flohofwoe 6y agoYeah, adding the inline keyword to C wasn't such a great idea in hindsight because it muddled the separation of interface and implementation (LTO is the better solution IMHO). A possible workaround would be that such a "declaration parser" would ignore the function implementation block (but inline code would make the library unusable from C++ anyway). As for macros: they would simply be resolved by the declaration parser, and either the result is parsable as declarations or not (which would then be an error).
- i-am-curious 6y agoDoesn't LTO interfere with debugging massively?