The C compiler is rather liberal about type checking programs, it doesn't check array indices are within bounds either. There is a stricter checker called lint which will check your program, but won't generate any runnable code. It is a good idea to use lint to check your programs before they are completed. This is done by typing
lint testprog.c
Lint is very fussy, and generally produces a long list of messages about minor problems with the program. Many of these will be quite harmless. Experience will teach you to recognise the important messages, and those which can be ignored safely.