Re: Cannot compile with _FILE_OFFSET_BITS = 64



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.

-- Richard
--
:wq
.



Relevant Pages

  • Re: what will happen after i use free()???
    ... Inserting a cast before malloc is not needed, ... 56 bits while int is only 48 bits. ... So casting that value requires some ... Use cast only if you are absolutely sure that yor really needs the ...
    (comp.lang.c)
  • Re: Simple Casting Question
    ... only in the form (int to float),,, ... or just casting identical types, so I hope that I can avoid some ... None of the conversions you describe ... In most cases where a cast is used, ...
    (comp.lang.c)
  • Re: Opinion on coding style.
    ... I don't like the way they are casting to LPCTSTR and int. ... In my opinion, if you are doing a cast, then code it as a cast, not as a ...
    (microsoft.public.vc.language)
  • Re: Opinion on coding style.
    ... I don't like the way they are casting to LPCTSTR and int. ... In my opinion, if you are doing a cast, then code it as a cast, not as a ...
    (microsoft.public.vc.language)
  • Re: Newbie: Inheritage, overloading and casting
    ... > class B extends A { ... No casting is required because every object is a descendant of Object. ... However, when getting objects back out of a Vector, you have to cast them ... A long is bigger than an int, so casting from int to long will ...
    (comp.lang.java.help)