This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcc 3.3: long long bug?
- From: Andreas Schwab <schwab at suse dot de>
- To: "A.R. Ashok Kumar" <ashokar at sankhya dot com>
- Cc: Lev Assinovsky <LAssinovsky at algorithm dot aelita dot com>,John Love-Jensen <eljay at adobe dot com>,Eric Botcazou <ebotcazou at libertysurf dot fr>, gcc-bugs at gcc dot gnu dot org,gcc-help at gcc dot gnu dot org
- Date: Mon, 07 Apr 2003 16:04:19 +0200
- Subject: Re: gcc 3.3: long long bug?
- References: <Pine.GSO.4.21.0304071852200.361-100000@sun103>
"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."