Ben Bacarisse <> writes:
> Tim Rentsch <> writes:
>
>> glen herrmannsfeldt <> writes:
>>
>>>> [snip]
>>>
>>> C requires char to be at least 8 bits, but it can be more. All
>>> other types have to be multiples (including 1) of the size of
>>> char.
>>>
>>> That seems to prohibit a four bit type, which would be especially
>>> useful on a four bit processor.
>>
>> There's no reason a conforming implementation couldn't provide its
>> own four-bit data types, including arrays of such data types. The
>> rule that all non-bitfield types must be multiples of 'char' in
>> width applies only to Standard-defined types, not to types provided
>> as part of extensions.
>
> Do you mean 6.2.6.1 p2? I.e. this:
>
> 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.
>
> If so, how can a 4-bit object be exempt; or would the implementation
> somehow avoid making these things objects?
Surely this is an easy question to answer. If a variable having
a hitherto unknown datatype is stored in a region of memory, what
difference does it make whether we call that region of memory an
"object" or a "nobject"? The "objectness" of a region of memory
has no meaning except insofar as it implies properties for some
semantic entities defined in part with reference to the term.
As long as those entities have the specified properties, there's
no way of knowing what terminology the implementors use when
talking among themselves about the implementation; it doesn't
matter whether they call everything an object, or distinguish
between "objects" and "nobjects", etc.
|