Subject: pointer dereferenced to incomplete type
From: [email-masked] (Bill J. Buie)

29 Sep 1997 11:37:02 -0700
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: [email-masked]

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 [email-masked].  If enough people
ask, I'll summarize what I discover.

Thanks,

	--Bill
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".