gcc C++ app: need a double, but gcc converts back to long

Mike MacCana mike.maccana@gmail.com
Fri Apr 20 02:35:00 GMT 2007


On 4/18/07, Jack Andrews <effbiae@gmail.com> wrote:
> > problem to solve: the app fails on all files larger than 4.2GB. The
>
> 4.2GB is around 2^32B.  ie, you probably have an overflow problem

Yup.

> you want FileSize to return an  unsigned long long  (a 64 bit value),
> so declare fileSize as an unsigned long long.

Done.

> however, i get the impression that FileSize only returns a 32 bit
> value, so you need to  change this.  post the source for FileSize and
> i'll see if i can help.

Done. Other things that may be of interest:
* I'm compiling with  -D_FILE_OFFSET_BITS for large file support.
* Another potential cause fileList (see FSutils.cpp) somehow ignoring
large files - I can't see why but as I mentioned I'm not much of a C++
programmer.

Thanks very much,

Mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: utils.cpp
Type: text/x-c++src
Size: 5792 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20070420/1d4abdb8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FSUtils.cpp
Type: text/x-c++src
Size: 4705 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20070420/1d4abdb8/attachment-0001.bin>


More information about the Gcc-help mailing list