[Info-vax] C limitations, was: Re: VMS process communication

Johnny Billquist bqt at softjar.se
Wed Mar 29 11:42:12 EDT 2023


On 2023-03-28 14:16, Arne Vajhøj wrote:
> On 3/28/2023 4:06 AM, Single Stage to Orbit wrote:
>> On Tue, 2023-03-28 at 00:16 +0200, Johnny Billquist wrote:
>>> Actually, this one is worse. char is implementation defined if it is
>>> signed or not (really - the standard says so).
>>> If you think/assume they are signed, you're asking for it...
>>
>> Which is why stdint.h (or cstdint) was invented with explicit types
>> (uint8_t, uint64_t etc)
> 
> They should be used.
> 
> Just note that the spec says "These types are optional.", but
> I suspect that all the common platforms has them.

The thing is, char is very special. It is the only one that is 
implementation defined if it is signed or unsigned. All the others 
(short, int, long, long long) are by definition signed.

So this goes a little outside of stdint.h as well. It's just that char, 
for whatever reason, is more weird/implementation specific than anything 
else in C.

   Johnny




More information about the Info-vax mailing list