delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/09/29/11:37:02

From: wjb AT bbt DOT com (Bill J. Buie)
Subject: pointer dereferenced to incomplete type
29 Sep 1997 11:37:02 -0700 :
Message-ID: <199709291759.NAA19225.cygnus.gnu-win32@sith.bbt.com>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

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 AT bbt DOT 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 AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019