Article View: comp.std.c
Article #5381struct declarations in dpANS C
From: David Keppel
Date: Fri, 21 Oct 1988 15:16
Date: Fri, 21 Oct 1988 15:16
24 lines
1286 bytes
1286 bytes
I have code of the form:
typedef void (*rtl_fp)( struct save_t *, int n, rtl_t *curr );
typedef struct everyn_t {
int n;
rtl_fp func;
} everyn_t;
In normal use 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;
(In which case the compiler notes that there is an "empty
declaration".) Question: is this proper behavior?
;-D on ( Prototypical Problematical Pterodactyl ) Pardo
--
pardo@cs.washington.edu
{rutgers,cornell,ucsd,ubc-cs,tektronix}!uw-beaver!june!pardo
Technical Details
Message-ID:
<6157@june.cs.washington.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!mailrus!cornell!uw-beaver!uw-june!pardoShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!mailrus!cornell!uw-beaver!uw-june!pardo From: pardo@june.cs.washington.edu (David Keppel) Newsgroups: comp.std.c Subject: struct declarations in dpANS C Summary: Forward declaration before a prototype typedef? Message-ID: <6157@june.cs.washington.edu> Date: 21 Oct 88 15:16:10 GMT Reply-To: pardo@cs.washington.edu (David Keppel) Organization: U of Washington, Computer Science, Seattle Lines: 24