On 7/26/16, Joseph Myers <jos...@codesourcery.com> wrote: > On Tue, 26 Jul 2016, Warren D Smith wrote: > >> (And in the case of uint4_t, it actually would not even BE an >> "extension" since as I said, >> the standard already allows providing other sizes.) > > Only sizes which are an integer number of bytes with no padding bits.
wikipedia: "The C99 standard includes definitions of several new integer types to enhance the portability of programs.[2] The already available basic integer types were deemed insufficient, because their actual sizes are implementation defined and may vary across different systems... All new types are defined in <inttypes.h> header (cinttypes header in C++) and also are available at <stdint.h> header (cstdint header in C++). The types can be grouped into the following categories: * Exact-width integer types which are guaranteed to have the same number N of bits across all implementations. Included only if it is available in the implementation..." This wikipedia page nowhere says it must be an integer number of bytes with no padding. And you will notice they *intentionally* chose to name them int8_t meaning 8 BITs wide, and *not* meaning 8 BYTEs wide, intentionally choosing those names presumably because they wanted to permit sizes not a multiple of 8. And they said "only if available in implementation" which gcc chose to interpret as "we're not going to make other sizes available, hahahaha." But gcc could choose to get ahead of the other compilers, leading not following, by making them available. If you were really ambitious you could provide int7_t etc (w.g. all integer sizes up to 64) but I am not asking for that level of ambition. I am asking merely for the easy sizes 1, 2 and 4 which you plainly have already written the code to do, just change some numbers. You are free to attack the standards bodies as being idiots. But they weren't being idiots in this decision.