delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/28/17:42:58

Message-Id: <m0xQKKG-0007qSC@fwd01.btx.dtag.de>
Date: Tue, 28 Oct 1997 23:41:28 +0200
To: eliz AT is DOT elta DOT co DOT il, djgpp AT delorie DOT com
References: <Pine DOT SUN DOT 3 DOT 91 DOT 971028104118 DOT 22947I-100000 AT is>
Subject: Re: [Q]: unsigned char
MIME-Version: 1.0
From: Georg DOT Kolling AT t-online DOT de (Georg Kolling)

Eli Zaretskii schrieb:
>
> On Mon, 27 Oct 1997, Georg Kolling wrote:
>
> > Using exactly this code, the compiler should give you the warning
> > "multi-character character constant" because of "'\xFD'".
> > '\xFD' represented as a number is 796411460, which can never be represented
> > with an unsigned char.
>
> I think you are wrong.  'c' constants are not character constants,
> they are ints.  You can verify it with a simple test program I attach
> at the end of this message.  It prints 4 for the sizeof of all the
> constants, which means they are ints.  That is why GCC doesn't say
> anything about multi-character constants.

Well, GCC says something about multi-character constants, but I made a dumb typo
when I tested this code. I wrote '/xFD' instead of '\xFD' and this will really
make GCC complain about a multi-character constant. But I have never seen this
format for hex numbers before, only 0xFD and 0FDh.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019