This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc 3.3: long long bug?


"A.R. Ashok Kumar" <ashokar at sankhya dot com> writes:

|> Hi,
|> 
|> > I think gcc 3.2 (which didn't give me any errors)
|> > behaves more properly, automatically converting 
|> > rvalue to lvalue. Such behavior also solves
|> > "long long long ..." problems.
|> 
|>   Have you obtained correct result? 
|> 
|>   For me, the following program gives wrong result(using gcc 2.7.2 on
|>   sparc-sun-solaris2.3).
|> 
|> ------
|> const long long n = 34359738368LL;
|> int  main() {
|>         printf("%ld\n", n);

Undefined behaviour.  %ld expects long, but n is long long.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab at suse dot 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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]