Yes. But ‘long’ is not. It is also a modifier. So why allow “long” or “short" but not “unsigned”? Or are you also writing “long int” and “short int”?
No, really not, at least as far as C and usage are concerned. It’s just a personal preference. So if Frediano prefers to write ‘unsigned’, I think it’s OK, and I will most likely write the same way.
It is as customary to write ‘unsigned’ alone as it is to write ‘long’. In the Linux source code ‘arch’ directory, I find over 2200 occurrences of ‘unsigned’ not followed by any type. Granted, there are about 10x as many ‘unsigned int’ and 20 times as many ‘unsigned long’. But 2200 occurrences show it’s certainly not “unusual".
The language is quite clear that ‘unsigned’ means ‘unsigned int’. There is no guessing involved whatsoever. The guessing about the size is because C is not specific about the size of ‘int’ in bits, which is why we have <stdint.h>. I think that we can agree that this particular aspect of the C syntax is messy. That does not mean we have to invent / enforce rules that don’t exist. Feel free to write ‘unsigned int’ if you want. No reason to force your personal preference on people who prefer the shorter ‘unsigned’ form. Christophe
|
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel