Long File Support in GCC (C++)

This is a boring technical post.

GCC 3.4 has long file support builtin for C++ see the _GLIBCXX_USE_LFS flag in “c++config.h”. If you check the file “g++-v3/istream”, you’ll notice that the “seek get location” function is defined as “seekg(off_type)” where “off_type” is a typedef for “streamoff” which, itself, is defined as:

typedef int64_t streamoff;
typedef long long streamoff;

So, when you seek get or put positions in a file, you are actually passing a 64 bits integer.

Of course, it would be surprising if GCC would not support long files by default in C++, but I’m the curious type.

Published by

Daniel Lemire

A computer science professor at the University of Quebec (TELUQ).

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax