home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Bug_Fixes / Net.v7bugs / 0052 < prev    next >
Encoding:
Text File  |  1982-01-04  |  533 b   |  24 lines

  1. Autzoo.1248
  2. net.bugs.v7
  3. utzoo!henry
  4. Mon Jan  4 19:16:17 1982
  5. sizeof type botch
  6. The following program displays a bug in the V7 C compiler.  Whether this
  7. should be fixed by revising the documentation or changing the code is a
  8. good question.
  9.  
  10. /*
  11.  * sizeof is supposed to be semantically an integer constant.  It's not,
  12.  * in the V7 compiler:  its type is always "unsigned", which an integer
  13.  * constant never is.
  14.  */
  15.  
  16. #define    BIG    20000    /* 40000 / sizeof(int) */
  17.  
  18. int foo[BIG];
  19.  
  20. main()
  21. {
  22.     printf("%D == %D (!)\n", 40000, sizeof(foo));
  23. }
  24.