Re:Principles for C programming
by birc_a on Thursday March 16, 2017 @11:49AM
(#13886001)
I'm not sure which parts of that you are referring to as unavoidable since C can do modules just fine without any mess.
Define the functions you want to implement as static functions and add something like this at the bottom of the file:
Then either stick `omstdout` in a list of modules known at compile-time or compile separately and use dlopen/dlsym to get the one necessary symbol.
No GNUisms, no language extensions, no linker tricks, no macro magic.
C has problems but it's not that hard to create readable code in it.
C has problems but it's not that hard to create readable code in it.