3 ms·
In retrospect, flexible bit-width types were a mistake. I'm not sure in what case you get much benefit by ignoring the domain of your variable.
by DubiousPusher 4y ago
In retrospect, flexible bit-width types were a mistake. I'm not sure in what case you get much benefit by ignoring the domain of your variable.
- anfilt 4y agoIt's not exactly ignored in C itself. That's what things like the sizeof() operator are for and standard macros like INT_MAX and INT_MIN. The problem here is once compiled this information is not readily accessible without being able to read a C Header. That's why the author here mentions parsing a C header and says most people just end up letting a compiler do that. If your writing C and ignoring things like INT_MAX or the minimum range requirements specified by the standard or not using sizeof() when your worried the memory size of these base types. Your code is not going to be portable. C definitely let's you handle and know the domain of your variables.
- nwellnhof 4y agoWell, different architectures have different word sizes. What should strlen return? A 64-bit value on every platform?
- tmtvl 4y agoA 256-bit value on every platform. 256 bits ought to be enough for everyone.