Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: Sort char array
Date: Wed, 23 Oct 2019 05:02:53 -0700
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <86eez3hdoy.fsf@linuxsc.com>
References: <5alnF.1041354$WI2.353384@fx34.am4> <87tv8ggaxh.fsf@bsb.me.uk> <87mue8fx7b.fsf@bsb.me.uk> <1QInF.797536$aq7.506537@fx09.am4> <875zkwf27e.fsf@bsb.me.uk> <87a7a66eyk.fsf@bsb.me.uk> <05020370-4edc-457f-a038-f51efbb47cdf@googlegroups.com> <87tv8d4kys.fsf@bsb.me.uk> <3obpF.121293$LC2.25145@fx45.iad> <86tv874jsq.fsf@linuxsc.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="09129d99e56165cafc27964696c7f4e6"; logging-data="30185"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19gNv8CjIF8uDx/DkMAlAlsOK42mv6+39E="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:yjkQutMUNFXxQFDzaqlMqjDg9f8= sha1:D651YkyGeoCxt6hMnAKu9S8dfD0=
Xref: csiph.com comp.lang.c:147171
Richard Damon writes:
> On 10/17/19 8:51 AM, Tim Rentsch wrote:
>
>> Richard Damon writes:
>>
>>> C has 11 standard integer types. PERIOD.
>>
>> An argument could be made that C has 12 standard integer types,
>> since 'signed int' is not perfectly identical to 'int'. (The
>> difference arises in declaring bitfield members.) Besides that
>> miniscule exception though you assertions are spot on.
>
> Except that for a bit field, the declaration of the type of a field as
> int doesn't create a type that is distinct from signed int and unsigned
> int like char does, but is implementation defined if int is to be
> considered as signed int or unsigned int. In other words, no bit field
> member has a type of 'int', but only signed int or unsigned int, and a
> field declared as just int will be treated as one or the other as
> defined and documented by the implementation.
The key point is that 'int' needs to be tracked separately in the
type system.
> If I am reading the standard right, I think that decision only applies
> to the literal string int (or after macro replacement), and not for a
> typedef.
It is because 'int' needs to be tracked through typedefs that
prompted me to make the comment. Probably I should have said
that, but the followup by Keith Thompson has now clarified it.