ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Воскресенье
7 июля
207332 Топик полностью
ReAl (23.08.2010 18:37, просмотров: 59) ответил SciFi на Нет, в стандарте C99 иначе:
А, ну да, ограничения снизу есть, причём даже в С89. Я имелл виду, что 1-битовый short int нарушает это: 
6.2.5 Types3 An object declared as type char is large enough to store any member of the basic execution character set.
Т.е. объект char не может занимать меньше даже семи бит.
6.2.6 Representations of types 6.2.6.1 General 2 Except for bit-fields, objects are composed of contiguous sequences of one or more bytes, the number, order, and encoding of which are either explicitly specified or implementation-defined. 4 Values stored in non-bit-field objects of any other object type consist of n × CHAR_BIT bits, where n is the size of an object of that type, in bytes.
Т.е. любой другой объект кроме битового поля может занимать только кратно char-у
6.2.6.2 Integer types 1 For unsigned integer types other than unsigned char, the bits of the object representation shall be divided into two groups: value bits and padding bits (there need not be any of the latter). If there are N value bits, each bit shall represent a different power of 2 between 1 and 2 N −1 , so that objects of that type shall be capable of representing values from 0 to 2 N − 1 using a pure binary representation; this shall be known as the value representation. The values of any padding bits are unspecified. 2 For signed integer types, the bits of the object representation shall be divided into three groups: value bits, padding bits, and the sign bit. There need not be any padding bits; there shall be exactly one sign bit.
А вот именно это место (если не учитвать другие ограничения) вроде как позволяет беззнаковому целому типу иметь всего один бит для предствления значения, но до размера минимум в CHAR_BIT будут идти биты-заполнители. Т.е. один бит в памяти всё равно нельзя.