3 ms·
He's not wrong per se but this shows how utterly broken C is. And macros are a "bandage" that make the problem worse. > include files should never include incl
by raverbashing 6y ago
He's not wrong per se but this shows how utterly broken C is. And macros are a "bandage" that make the problem worse.
> include files should never include include files
Cool, there are two possible outtakes to this:
1) Why aren't include files generated automatically from C files then? (If you can't include anything this means they shouldn't have no "code", so they can't call anything, so they can't include anything or reference anything else)
2) Why aren't they a compilation target? (yes I know modern GCC allows you to do that) but why doesn't C specify a binary representation for them.
- pjmlp 6y agoBecause ISO doesn't force language implementers to do such tooling, which is also why there is UB to start with.
- saagarjha 6y agoAgree with the first part, but I’m not sure where you’re going with the second.
- pjmlp 6y agoThe unwillingness to standardise specific language features back in the 80s, during C89, because they would break pseudo compatible K&R compilers like Small-C, or force vendors of now long dead platforms, to actually spend a little more effort improving their toolchains.
- sergeykish 6y agoHe addressed performance issue. Just what parent asked — separate interface and implementation. Looks like you ask "why convention, not restriction?" It solved their problems while maintaining interoperation with UNIX world [1]. If convention is not enough for you, you may define format and tooling. [1] http://doc.cat-v.org/plan_9/4th_edition/papers/ape http://doc.cat-v.org/plan_9/4th_edition/papers/ape