On Fri, 24 Sep 2004, Tom Lane wrote:

> Kris Jurka <[EMAIL PROTECTED]> writes:
> > UINT64CONST produces these in a number of places:
> > "xlog.c", line 552: warning: constant promoted to unsigned long long
> 
> > it likes either ##ULL or unadorned.  The problem is we're taking a 
> > constant larger than long long and explicitly saying it's a long long.
> 
> No other machine we use thinks it's larger than long long --- are you
> sure about that?  If that is the problem, why does the message use the
> word "promoted" and not, say, "truncated"?

Well, it's not really truncated it just overflows long long.

Looking at the following code, the warning is only produced for the c2 
constant.

#define ULL(x) (x##ULL)
#define LL(x) (x##LL)

void f() { 
        unsigned long long c1 = ULL(0xFFFFFFFFFFFFFFFF);
        unsigned long long c2 = LL(0xFFFFFFFFFFFFFFFF);
        unsigned long long c3 = 0xFFFFFFFFFFFFFFFF;
        unsigned long long c4 = ULL(0x1111111111111111);
        unsigned long long c5 = LL(0x1111111111111111);
        unsigned long long c6 = 0x1111111111111111;
}



---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to