sizeof type botch
utzoo!henry
utzoo!henry
Mon Jan 4 19:16:17 AEST 1982
The following program displays a bug in the V7 C compiler. Whether this
should be fixed by revising the documentation or changing the code is a
good question.
/*
* sizeof is supposed to be semantically an integer constant. It's not,
* in the V7 compiler: its type is always "unsigned", which an integer
* constant never is.
*/
#define BIG 20000 /* 40000 / sizeof(int) */
int foo[BIG];
main()
{
printf("%D == %D (!)\n", 40000, sizeof(foo));
}
More information about the Net.bugs.v7
mailing list