Structure tags

Tsutomu Itoh t-itoh at utsm.nm.fujitsu.co.jp
Thu Feb 7 14:21:42 AEST 1991


Could someone please clarify the correct implementation of structure
tags and incomplete types as in the following fragments, assume there
are no other declarations of struct foo in scope:-

1a.

struct foo {int i;};
struct foo;
struct foo bar;

1b.
struct foo;
struct foo {int i;};
struct foo bar;

Should the compiler object to 1a but not to 1b as implied in 3.5.2.3?
If so it seems many compilers allow both.

2a
int bar(struct foo);
struct foo {int i;};

2b
struct foo;
int bar(struct foo);
struct foo {int i;};

Is the empty structure declaration necessary?

If you mail any replies please cc to paul at tetrauk.uucp

Thanks
--
Paul Ashton
-- 

$BIY;NDL3t<02q<R!!>BDE9)>l!!%*!<%W%s%7%93+!KBh0l3+H/ItBhFs3+H/2](J
$B0KF#!!6P!!!!(Jt-itoh at nm.fujitsu.co.jp 



More information about the Comp.std.c mailing list