structure problem - error or warning?

James J. Roche jim at ccice5.UUCP
Sat Oct 13 02:33:19 AEST 1984


Why does the C compiler only give a warning instead of an error on the
use of an illegal structure member. The following code example demonstrates
what I mean:

main()
	{
	struct v {
		int w;
		};

	struct x {
		int y;
		} z;

	z.w = 0;
	}

The C compiler gives the warning "illegal member use: w" on the line
z.w = 0.  It seems to me that this should be an error. Is this a bug
in the C compiler? Thanks in advance for any answers that you can provide.
-- 

		Jim Roche
		Computer Consoles Inc.
		ccice5:jim (CCI Central Engineering systems only)
		{rochester, ritcv, ccivax, rayssd, rlgvax}!ccice5!jim (UUCP)



More information about the Comp.lang.c mailing list