public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: gcc-help@gcc.gnu.org
Cc: Axel Freyn <axel-freyn@gmx.de>
Subject: Re: infinite for-loop and related question
Date: Thu, 17 Feb 2011 14:08:00 -0000	[thread overview]
Message-ID: <AANLkTin=GUXjqyTB67WU0BuambPRXnnSuqv0eQqGLCr7@mail.gmail.com> (raw)
In-Reply-To: <20110217130938.GT5274@axel>

On 17 February 2011 13:09, Axel Freyn wrote:
>>
>> I'm guessing you didn't bother to actually compile that and test it?
> Well, I did. But using gcc instead of g++. I get values <128 as soon as
> I add the integer conversion (in C code).

Jason's original code used char i(1) which is not valid C  ;-)

In any case, I get the same behaviour in C as C++, the cast to int
makes no difference.

Did you use optimization?

>> See 5.2.2 [expr.call] paragraph 7 in the C++ standard.  Arguments to
>> varargs functions are subject to integral promotions.
> In C++ it does not make any difference.

C has the same rules for default argument promotions, see 6.5.2.2 paragraph 6

  reply	other threads:[~2011-02-17 14:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16 20:17 Jason Mancini
2011-02-16 20:41 ` Jonathan Wakely
2011-02-16 21:37   ` Jason Mancini
2011-02-16 21:49     ` Bob Plantz
2011-02-16 23:00       ` Jonathan Wakely
2011-02-16 23:22         ` Thomas Martitz
2011-02-17  6:31           ` Jonathan Wakely
2011-02-17 10:36       ` Axel Freyn
2011-02-17 12:23         ` Jonathan Wakely
2011-02-17 13:16           ` Axel Freyn
2011-02-17 14:08             ` Jonathan Wakely [this message]
2011-02-16 23:00 Bill McEnaney

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='AANLkTin=GUXjqyTB67WU0BuambPRXnnSuqv0eQqGLCr7@mail.gmail.com' \
    --to=jwakely.gcc@gmail.com \
    --cc=axel-freyn@gmx.de \
    --cc=gcc-help@gcc.gnu.org \
    /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).