4 msgFW: Gcc-4.2.2 compile failure
6 msgFW: Mixing C/C++ code
8 msglibstdc++.so conflict
5 msgconfused at code generation for a empty loop
3 msgNew Build Error On gcc-4.1.2
2 msgNew Build Error On gcc-3.4.6
2 msgAuto inlining with only -O2?
7 msg4.2 build problem on redhat x86_64
3 msgBasic Question on Building Multi-Threaded 'C' A...

Problems with using identifier long long int in...
\ Maxim Areshkau (29 Nov 2007)
. \ John Love-Jensen (29 Nov 2007)
. \ Marco Manfredini (29 Nov 2007)

27 msgRe: Missing warning about uninitialized variable.
2 msgMissing warning about uninitialized variable
1 msgDude, protects SSP's canary itself in va_lists?
2 msgMake Error In gcc-4.1.2
1 msgHang Error In gcc-4.0.4
2 msgMake Error In gcc-3.4.6
1 msg(kein Betreff)
2 msgC Preprocessor for 64-bit
2 msgstatic links
2 msgBuggish behaviour of nested unnamed struct in e...
Subject:Re: Problems with using identifier long long int in gcc++
Group:Gcc-help
From:Marco Manfredini
Date:29 Nov 2007


On Thursday 29 November 2007 17:01, Maxim Areshkau wrote:
> l1: unsigned long long a;
> l2: cout << sizeof(a) << endl;
> l3: a = 1281474976710655;
> l4: cout << a << endl;
> When we trying to compile such code with gcc++, it's throw error that
> the constant '1281474976710655' is too large for long long, it is only

An decimal integer literal without suffix has either type int or long int. If
the value can not be represented as long int, the behavior is undefined
(which is bad thing). As Maxim wrote, add ULL to the literal.

> 2**48-1, when max number for unsigned long long is 2**64. This code
> compiles normal when we use Microsoft compiler.

Undefined Behavior: gcc gives you an clear error message, Microsoft tries to
"fix it".



© 2004-2008 readlist.com