Newsgroups: comp.std.c
Path: utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: struct declarations in dpANS C
Message-ID: <1988Oct23.031212.23182@utzoo.uucp>
Organization: U of Toronto Zoology
References: <6157@june.cs.washington.edu>
Date: Sun, 23 Oct 88 03:12:12 GMT

In article <6157@june.cs.washington.edu> pardo@cs.washington.edu (David Keppel) writes:
>    typedef void (*rtl_fp)( struct save_t *, int n,  rtl_t *curr );
>... the "struct save_t" is declared in another file that
>depends on declarations in this (.h) file.  Even though struct save_t
>is defined before the rtl_fp is used, this declaration still causes
>the compiler to emit warnings about "argument passing between
>incomopatible pointer types" unless I precede the function declaration
>with
>    struct save_t;

This is correct.  save_t is not known at the first time it is used, i.e.
in the typedef for rtl_fp.  Therefore it is entirely proper, and indeed
highly desirable, for the compiler to object.  Adding "struct save_t;"
makes it a known, although incomplete, type.  The compiler's grumbling
about "struct save_t;" is improper; probably somebody forgot to fix
that when he added function prototypes.
-- 
The meek can have the Earth;    |    Henry Spencer at U of Toronto Zoology
the rest of us have other plans.|uunet!attcan!utzoo!henry henry@zoo.toronto.edu
