This is the mail archive of the gcc@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]
Other format: [Raw text]

gcc-3.3.2 freebsd 4.9 bug?


Hi, is this a bug of gcc?

I compile these code under gcc-3.3.2 or gcc-3.3.3-20040112 ,FreeBSD 4.9 , can't run correct.    but under linux ,it run good!

#include <stdio.h>
#include <iostream>
#include <fstream>
using namespace std;

int main(int argc, char *argv[])
{

int nCount,total=0;
char buf[129];

fstream ff(argv[1],ios::in|ios::binary);

while((nCount =  ff.readsome(buf,128))>0)
        {
        total+=nCount;
        }
printf("size: %d\n",total);
        return 0;
}

=====================================================================



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