Type checking: shouldn't lint/cc complain?

Danny Glasser dglasser at yale.ARPA
Wed Oct 10 01:47:42 AEST 1984


Let's say I have the following C program:

/* Beginning */
typedef int FOO ;
typedef int BAR ;

#define XXX (FOO) 1

main()
{
	BAR fff ;

	fff = XXX ;
}
/* End */

When I run lint or cc on this program (on 4.1BSD or 4.2BSD), I
get no complaints about the fact that fff is a variable of type
BAR and it is being assigned a value of type FOO.  Now I wouldn't
want the C compiler to crap out on this code (as Pascal probably
would with the equivalent program), but shouldn't the compiler
(or at least lint) complain about this?

				    -- Danny Glasser
				    {decvax,allegra,ima}!yale!dglasser
				    Glasser-Daniel at YALE.ARPA
					[NOT dglasser at YALE.ARPA]



More information about the Comp.lang.c mailing list