[mod.computers.masscomp] Bug using sizeof in cc

dhb@bek-mc.UUCP (08/18/86)

I ran across a bug using sizeof with an expression when the expression
is a typedefed variable of an array type.  The following program illustrates
the problem:

typedef int	BITMAP[4];

main ()

{
    BITMAP	map;

    printf("sizeof (BITMAP) = %d\n", sizeof (BITMAP));
    printf("sizeof (map) = %d\n", sizeof (map));
}

results in the output

    sizeof (BITMAP) = 16
    sizeof (map) = 4

I have sent in an SQR on the problem.

Dave Bilitch		{ topaz | seismo }!cit-vax!bek-mc!dhb
CALTECH