|
-
June 15th, 2006, 08:16 AM
#1
fopen vs. fopen64
Hello
To be able to open large logfiles in a software, I change the necessary "fopen"-command to "fopen64". This procedure works and is described in a patch, too. However when I compile it I get some warnings:
--> In function `main':
--> warning: implicit declaration of function `fopen64'
--> warning: assignment makes pointer from integer without a cast
Before patching I had:
Code:
FILE *log_fp;
...
log_fp = fopen(log_fname,"r");
After patching:
Code:
FILE *log_fp;
...
log_fp = fopen64(log_fname,"r");
How can I avoid that warning???
-
June 15th, 2006, 08:51 AM
#2
Re: fopen vs. fopen64
 Originally Posted by frei
Hello
To be able to open large logfiles in a software, I change the necessary "fopen"-command to "fopen64". This procedure works and is described in a patch, too. However when I compile it I get some warnings:
--> In function `main':
--> warning: implicit declaration of function `fopen64'
--> warning: assignment makes pointer from integer without a cast
Before patching I had:
Code:
FILE *log_fp;
...
log_fp = fopen(log_fname,"r");
After patching:
Code:
FILE *log_fp;
...
log_fp = fopen64(log_fname,"r");
How can I avoid that warning???
I assume you are using C rather than C++. In C, if you call an undeclared function, the compiler assumes it returns an int, and then complains that you are converting the int to a pointer. The fopen64 routine is specific to Linux; if that is what you are using, make sure you are including the righr headers.
Hope that helps.
-
June 15th, 2006, 11:35 AM
#3
Re: fopen vs. fopen64
Yes, I'm using C, not C++.
The function is declared: I have the stdio.h header included (#include <stdio.h>).
The program works, but I get the above warnings when I use fopen64 instead of fopen...
I really don't know why... Does someone have an idea to get rid of the problem??
Last edited by frei; June 16th, 2006 at 11:13 AM.
-
January 5th, 2007, 09:46 AM
#4
Re: fopen vs. fopen64
You need to compile with -D_LARGEFILE64_SOURCE option.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|