3 ms·
Mostly agree with Linus that typedef abuse is annoying except one example: size_t is platform-dependent and not the same as unsigned int.
by snorkel 16y ago
Mostly agree with Linus that typedef abuse is annoying except one example: size_t is platform-dependent and not the same as unsigned int.
- Someone 16y agoI also do not understand his "We actually have real _problems_ due to this in the kernel, where people use "off_t", and it's not easily printk'able across different architectures (we used to have this same problem with size_t)." I see the problem with printk, but giving up the ability to typedef architecture-dependent types such as size_t because of it? The proper reaction, IMO, would have been to fix printk. Given that gcc already checks compatibility between format strings and arguments, it should not be that hard to add a special format character (say %?), and have the compiler replace it by a correct character for the argument passed.