Re: infinite for-loop and related question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux