Article View: comp.std.c
Article #2829Pointers to Incomplete Types in Prototypes
From: Joseph Schwartz
Date: Wed, 01 May 1991 18:16
Date: Wed, 01 May 1991 18:16
24 lines
1243 bytes
1243 bytes
Must an ANSI C compiler accept pointers to incomplete types in a
function prototype?
More specifically, if struct bar has not been defined, is an ANSI
compiler allowed to reject the following prototype:
extern void foo(struct bar *);
According to 3.1.2.5, struct bar is an incomplete type in this case,
and struct bar * is a pointer to an incomplete type.
I couldn't find anything in 3.5.4.3 that allows or forbids incomplete
types, or pointers to them, in function prototypes. Can anyone give
me more conclusive information? Our HP "ANSI" C compiler is complaining
about the above prototype, and I want some ammunition before I report
it to HP as a problem.
Thanks in advance for any help you can provide.
--
Joe Schwartz
Internet: xor@mts.rpi.edu
Bitnet: userez3n@rpitsmts
Technical Details
Message-ID:
<w!2g7+c@rpi.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!samsung!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!xorShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!samsung!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!xor From: xor@aix01.aix.rpi.edu (Joseph Schwartz) Newsgroups: comp.std.c Subject: Pointers to Incomplete Types in Prototypes Message-ID: <w!2g7+c@rpi.edu> Date: 1 May 91 18:16:15 GMT Organization: Rensselaer Polytechnic Institute, Troy NY Lines: 24 Nntp-Posting-Host: aix01srv.aix.rpi.edu