Re: Cannot compile with _FILE_OFFSET_BITS = 64



Scott.zhou wrote roughly:
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.

In this example, although I explicitly define _FILE_OFFSET_BITS 64, i
get the warning"integer overflow" [...]

I hope you also understand where the problem comes from! The point has
nothing to do with lseek() but rather with how C handles arithmetic, in
particular that it doesn't suddenly switch to a bigger integer type.

Uli

.



Relevant Pages

  • Re: Today is the International Lefthanders Day!
    ... He didn't think to switch to his other hand. ... handwriting came out pretty much the same either way. ... I had a friend in college like that. ... I did, however, cut a slot in the cast that would accommodate a guitar ...
    (rec.music.beatles)
  • Re: OT: Multiball! (Re: Orbquest)
    ... When you got in trouble you'd switch to the wizard ... the entire party by a single @ and noting who's in charge at any given ... So the character can be programmed to cast ... Players can also pause the game and manually input commands. ...
    (rec.games.roguelike.development)
  • Re: OT Merging Word Documents
    ... catman cast forth these pearls of wisdom ... There is a switch for copy that will combine any binary filetogether into one. ...
    (uk.rec.motorcycles)
  • LINQ and dynamic where clauses
    ... I believe the syntax is ... but cannot confirm it because when I try to cast my ... IQueryableemployees = ... switch ...
    (microsoft.public.dotnet.framework.aspnet)
  • WTB HT-32 Power switch
    ... I have an Hallicrafters HT-32 that the power switch died sometime in ... the past,it removed and replaced with a toggle switch on the cast ... I've acquired a new cast panel (3.5 pounds just ...
    (rec.radio.amateur.boatanchors)