This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Largefile problem with gcc3.0.2


Hi,

I've recently installed the latest release of the GNU compiler collection and
have discovered a rather nasty and mysterious problem.  Due to this, I've reverted
back to 2.95.3

I commonly access binary data files > 2 Gig's and have been enabling large
file support using -D_FILE_OFFSET_BITS=64.  I've found that if I add the
line #include <fstream> to a c++ source file, but mix this with a call to 
fopen, largefile support disappears (nm shows fopen being referenced in the
object rather than fopen64).  My operating system is Solaris 2.8.

The following reports an error when a 3 Gig file is opened:

  #include <stdio.h>
  #include <fstream>

  main()
  {
    FILE *fp = fopen("largefile.sgy", "rb");
    if(fp == NULL) perror("fopen");
  }


The following works just fine on the same 3 Gig file:

  #include <stdio.h>

  main()
  {
    FILE *fp = fopen("largefile.sgy", "rb");
    if(fp == NULL) perror("fopen");
  }

The compile line is: g++  -D_FILE_OFFSET_BITS=64 -o junk junk.c

Wilf Kruggel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]