Mail Archives: djgpp/1999/01/15/14:11:07
On 14 Jan 1999 19:05:48 -0700, "Tim Hoskins" <hoskinst AT cadvision DOT com>
wrote:
>What do these warnings mean and how can I fix them?
>
>Here's the errors in comilation ( DJGPP ):
>
>C:\Programs>gcc b.c -o b.exe
>b.c: In function `main':
>b.c:20: warning: assignment makes pointer from integer without a cast
>b.c:21: warning: assignment makes pointer from integer without a cast
>b.c:25: warning: assignment makes pointer from integer without a cast
>b.c:26: warning: assignment makes pointer from integer without a cast
>
>C:\Programs>
>
>And now the source:
>
>// b.c - a program to list the LFN version of a dos file name.
>// specify the directory to list file from as a command line argument.
>
>#include <stdio.h>
>#include <dos.h>
>
>struct find_t ffblk;
>
>int main( int argc, char *argv[] )
>{
>
> char *realname, *newname, *endofstring;
> int lenofstr, lenoffn;
>
> if ( argc < 2 )
> {
> printf("\n\nError, no parse directory.");
> exit(1);
> }
>
> if ( _dos_findfirst("*.*", _A_NORMAL, &ffblk) == 0 )
> {
> realname = _truename(ffblk.name, (char *)0);
> newname = strrchr(realname,92) + sizeof(char);
> printf("%s\n", newname);
> while ( _dos_findnext(&ffblk) == 0 )
> {
> realname = _truename(ffblk.name, (char *)0);
> newname = strrchr(realname,92) + sizeof(char);
> printf("%s\n", newname);
> }
> }
> else
> printf("no files\n");
>
> return 0;
>}
>
>// end of b.c
>
>Thanks,
>Tim Hoskins
><hoskinst AT cadvision DOT com>
If you compile with: gcc -Wall .... you will see that the proper
prototype of _truename is missing (in that case the compiler will
assume int _truename(...)). You should include <sys/stat.h> (see in
info). Than the warning is gone. For the other function: <string.h>
Greetings,
W. Aerts
- Raw text -