casting issue with realpath function (c programming)
Posted
by Ralph
on Stack Overflow
See other posts from Stack Overflow
or by Ralph
Published on 2009-10-18T03:06:19Z
Indexed on
2010/05/22
9:00 UTC
Read the original article
Hit count: 196
When I compile the following code:
#define _POSIX_C_SOURCE 200112L
#define _ISOC99_SOURCE
#define __EXTENSIONS__
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
int
main(int argc, char *argv[])
{
char *symlinkpath = argv[1];
char actualpath [PATH_MAX];
char *ptr;
ptr = realpath(symlinkpath, actualpath);
printf("%s\n", ptr);
}
I get a warning on the line that contains the call to the realpath function, saying:
warning: assignment makes pointer from integer without a cast
Anybody know what's up? I'm running Ubuntu Linux 9.04
© Stack Overflow or respective owner