Re: Cannot compile with _FILE_OFFSET_BITS = 64



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

.



Relevant Pages

  • Re: Cannot compile with _FILE_OFFSET_BITS = 64
    ... Ulrich Eckhardt wrote: ... that works without C99's long long type simply cast the expression to ... Casting the expression won't help, if it's already overflowed as an ... int. ...
    (comp.lang.c)
  • Re: threaded screws in 15th. century Sri Lanka ?
    ... Same general topic of fine metalworking. ... southeast asian areas, is done by even simpler methods, that of sand casting. ... cast without seeing a raw cast surface. ... screw, and the hole in the head of the image, that the helical screw goes ...
    (rec.crafts.jewelry)
  • Re: Copper Casting In America (Trevelyan)
    ... > some of the artifacts have been cast. ... experiments using only cold and hot working, without casting, ... > of direct evidence for casting techniques. ...
    (sci.archaeology)
  • Re: Copper Casting In America (Trevelyan)
    ... > some of the artifacts have been cast. ... experiments using only cold and hot working, without casting, ... > of direct evidence for casting techniques. ...
    (sci.anthropology)
  • Re: Baitcasting reels-the attractive antique that reel companies wont admit to
    ... and it's also not in the reel directions- ... but it is in any old literature about how to cast with a baitcaster ... casting distance facing the reel handle up during casting. ...
    (rec.outdoors.fishing.bass)