4 ms·
Holy @#$@, people. Did I wake up in a naïveté vortex? No, C doesn't define sizeof(int). It is implementation defined. But you don't change it once you imple
by CamperBob 15y ago
Holy @#$@, people. Did I wake up in a naïveté vortex?
No, C doesn't define sizeof(int). It is implementation defined. But you don't change it once you implement it in a given development environment... not if you want people to create and maintain production code with your tools. You don't speculate that one day you might want to change sizeof(int). It's just not something you do if you want to be taken seriously.
Is anyone in this thread over the age of 16?
- ori_b 15y agoGCC has options to change the size of int without even modifying the compiler. The size of integer types isn't even fixed within one implementation, in other words. If you write production C code that depends on anything other than the minimum sizes defined in limits.h, your code is buggy.
- CamperBob 15y agoGCC has options to change the size of int without even modifying the compiler Great, I'm very happy for them. If I ever wake up and decide to change sizeof(int), I can. Now what do you suppose is going to happen if the GCC committers wake up one day and decide to change sizeof(int) for everyone? I have a feeling we'd all see an awful lot of what you would apparently call "buggy code" if that ever happens. I also suspect there will be a pretty quick exodus of formerly loyal GCC users if that ever happens. No one will be able to trust the judgement of the compiler authors, at that point. Seriously. I feel like the only sane guy in the asylum here.
- deleted 15y ago[deleted]