Re: Cannot compile with _FILE_OFFSET_BITS = 64
- From: Ulrich Eckhardt <doomster@xxxxxxxx>
- Date: Mon, 31 Dec 2007 14:36:44 +0100
Richard Tobin wrote:
In article <5truv2F1f3un6U1@xxxxxxxxxxxxxxxxx>,
Ulrich Eckhardt <doomster@xxxxxxxx> wrote:
lseek64(fd, 4*1024*1024*1024, SEEK_SET) // integer overflow
Others already explained what is happening, but I'd suggest another
approach that works without C99's long long type simply cast the
expression to off_t, which will automatically be the correct 64 bit type,
regardless of whether you use C89 or C99.
Casting the expression won't help, if it's already overflowed as an
int.
Argh, well caught. Casting the first constant in above expression does the
job though.
Uli
.
- Follow-Ups:
- Re: Cannot compile with _FILE_OFFSET_BITS = 64
- From: Joe Wright
- Re: Cannot compile with _FILE_OFFSET_BITS = 64
- References:
- Re: Cannot compile with _FILE_OFFSET_BITS = 64
- From: Ulrich Eckhardt
- Re: Cannot compile with _FILE_OFFSET_BITS = 64
- From: Richard Tobin
- Re: Cannot compile with _FILE_OFFSET_BITS = 64
- Prev by Date: Re: Programming in standard c
- Next by Date: Redirect stdin ?
- Previous by thread: Re: Cannot compile with _FILE_OFFSET_BITS = 64
- Next by thread: Re: Cannot compile with _FILE_OFFSET_BITS = 64
- Index(es):
Relevant Pages
|
|