Autzoo.1248
net.bugs.v7
utzoo!henry
Mon Jan 4 19:16:17 1982
sizeof type botch
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));
}
-----------------------------------------------------------------
gopher://quux.org/ conversion by John Goerzen <
[email protected]>
of
http://communication.ucsd.edu/A-News/
This Usenet Oldnews Archive
article may be copied and distributed freely, provided:
1. There is no money collected for the text(s) of the articles.
2. The following notice remains appended to each copy:
The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996
Bruce Jones, Henry Spencer, David Wiseman.