pointer dereferenced to incomplete type
Bill J. Buie
wjb@bbt.com
Mon Sep 29 10:59:00 GMT 1997
Can anyone tell me what the error message on the subject line means?
The strange thing about the error is that when I tried to put together
a minimal program to illustrate it, my minimal program compiled and
ran perfectly. But in the context of a very large program I am
getting the error message in the subject line, and the compile fails.
Here is the minimal program, which works:
#include <stdio.h>
#include <time.h>
static struct tm *
getlt()
{
time_t date;
(void) time((long *)(&date));
return(localtime(&date));
}
main()
{
struct tm *workaround;
int number;
workaround = getlt();
number = workaround->tm_year;
printf("year = %d\n", number);
}
In the context of the large program, the line where I set number equal
to workaround->tm_year produces the error.
If details help, I am running the Cygwin beta 18 release on a windows
95 machine with 16MB RAM. The large application which fails is
nethack 3.2.1, the rogue-like game program. The source file I am
choking on is hacklib.c. I ran the file through the preprocessor to
make sure I wasn't getting bitten by the large number of #defines, and
the source the preprocessor kicks out is what I am expecting. People
on this list who have played with the nethack source may notice that
the source line in hacklib.c is really
return ( 1900 + getlt()->tm_year);
but I wanted to break the expression up so I could see where the the
error is coming from. When the minimal program worked, I replaced the
one line above with
workaround = getlt();
number = workaround->tm_year;
return(number);
but that still produced the error.
I'd prefer that responses be mailed to wjb@bbt.com. If enough people
ask, I'll summarize what I discover.
Thanks,
--Bill
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
More information about the Cygwin
mailing list