C inconsistency?

Larry Jones scjones at sdrc.UUCP
Sat Apr 1 09:08:53 AEST 1989


In article <1989Mar30.192903.28426 at gpu.utcs.toronto.edu>, sarathy at gpu.utcs.toronto.edu (Rajiv Sarathy) writes:
> Is this an inconsistency ?:
> 
> 	struct element {
> 	    char *key;
> 	    int level;
> 	    struct element **fpointer;
> 	}
> 	struct element *head[LEVELCAP];     /* array of pointers to struct */
> 
> Microsoft C 5.1 in MS-DOS compiles this alright, but neither cc nor gcc are
> able to compile in UNIX 4.1 (or is it 4.2, I can't remember).

If you look real carefully, you will notice that there's no
semicolon after the closing brace of the structure declaration.
This is a syntax error that is ignored by some compilers and very
badly diagnosed by others.

----
Larry Jones                         UUCP: uunet!sdrc!scjones
SDRC                                      scjones at sdrc.UU.NET
2000 Eastman Dr.                    BIX:  ltl
Milford, OH  45150                  AT&T: (513) 576-2070
"When all else fails, read the directions."



More information about the Comp.lang.c mailing list