Date: Tue, 18 Sep 2007 11:16:56 -0600 (MDT) From: Warner Losh <imp@bsdimp.com> To: mike@Reifenberger.com Cc: freebsd-arm@freebsd.org, cognet@freebsd.org Subject: Re: 64bit integer problem? Message-ID: <20070918.111656.28814048.imp@bsdimp.com> In-Reply-To: <20070918182508.V24397@fw.reifenberger.com> References: <20070918182508.V24397@fw.reifenberger.com>
next in thread | previous in thread | raw e-mail | index | archive | help
From: Michael Reifenberger <mike@Reifenberger.com> Subject: 64bit integer problem? Date: Tue, 18 Sep 2007 18:35:04 +0200 (CEST) > Hi, > > on my AVILA-arm board I'm unable to compile lang/perl > > On of the problems seems to be related to long long handling: > > The following program: > ############################## > #include <sys/types.h> > #include <stdio.h> > int main() { > long long q = 12345678901LL; > printf("%lld\n", q); > } > ############################## > > gives the output: > -2315945094416433150 > > Is there a endian issue? 12345678901 is 0x2DFDC1C35 2315945094416433151 is 0x2023E3CAFFFFFFFF -2315945094416433150 is therefore 0xdfdc1c3500000000 which the lower 32bits of 'q' shifted over 32 bits. Maybe this is an endian issue, since I don't see it on my AT91RM9200 based boards (which are little endian). Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070918.111656.28814048.imp>