This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFD: C pointer conversions that differ in unsignedness


On Mon, 5 Dec 2005, Mike Stump wrote:

> On Dec 5, 2005, at 9:53 AM, schopper-gcc@bfw-online.de wrote:
> > Oh right, what I really meant was 'char' instead of 'long'.
> > In fact I just took the type from the referenced article. Sorry for that.
> > 
> > So am I right that the compiler should distinguish between char, signed char
> > and unsigned char in the proposed way?
> 
> Good question.  I don't believe so:
> 
>       [#5] Each of the comma-separated sets  designates  the  same
>       type,  except  that  for  bit-fields,  it is implementation-
>       defined whether the specifier int designates the  same  type
>       as signed int or the same type as unsigned int.
> 
> [ note, I have a feeling they meant char, not int, I suspect someone might be
> able to provide a pointer to a DR for this. ]

Bringing bit-fields into the matter is just confusing things since you 
can't have pointers to bit-fields, but anyway char is not in a 
comma-separated set with signed char or unsigned char and for DR#315 it 
was proposed to say that whether char bit-fields have the same signedness 
as non-bit-fields is unspecified.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]