public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Momchil Velikov <velco@fadata.bg>
Cc: Alan Modra <amodra@bigpond.net.au>, gcc@gcc.gnu.org
Subject: Re: Undefined behavior in 950605-1.c
Date: Thu, 25 Jul 2002 11:24:00 -0000	[thread overview]
Message-ID: <je8z3z98rf.fsf@sykes.suse.de> (raw)
In-Reply-To: <873cu83skp.fsf@fadata.bg> (Momchil Velikov's message of "25 Jul 2002 15:22:46 +0300")

Momchil Velikov <velco@fadata.bg> writes:

|> >>>>> "Alan" == Alan Modra <amodra@bigpond.net.au> writes:
|> 
|> Alan> On Thu, Jul 25, 2002 at 12:53:59PM +0300, Momchil Velikov wrote:
|> >> representable if the promoted type of the parametar is unsigned.
|> 
|> Alan> Ah, but what is the promoted type of "unsigned char"?  int!
|> 
|> ISO/IEC 9899:1999 6.5.2.2 [#6]
|> 
|>   " ... the other promoted type is the corresponding unsigned integer
|>   type, ..."
|> 
|> IMHO, that means that it is legal for the promoted type of ``unsigned
|> char'' to be ``unsigned int''.

Only if UCHAR_MAX == UINT_MAX.  Otherwise int can represent all values of
unsigned char, thus unsigned char is promoted to int.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  reply	other threads:[~2002-07-25 14:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-25  7:08 Momchil Velikov
2002-07-25  8:54 ` Andreas Schwab
2002-07-25  9:04   ` Momchil Velikov
     [not found]     ` <20020725102412.GV26054@bubble.sa.bigpond.net.au>
2002-07-25 10:56       ` Momchil Velikov
2002-07-25 11:24         ` Andreas Schwab [this message]
2002-07-25 13:25         ` Richard Henderson
2002-07-26 14:47           ` Richard Earnshaw
2002-07-28  0:08             ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=je8z3z98rf.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=amodra@bigpond.net.au \
    --cc=gcc@gcc.gnu.org \
    --cc=velco@fadata.bg \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).