home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Bug_Fixes / Net.v7bugs / 0056 < prev    next >
Encoding:
Text File  |  1982-01-08  |  1.2 KB  |  27 lines

  1. Aresearch.203
  2. net.bugs.v7
  3. utzoo!decvax!ucbvax!ihnss!mhtsa!research!dmr
  4. Thu Jan  7 01:42:24 1982
  5. sizeof feature
  6. been officially unsigned.  I believe this was documented with the distribution,
  7. although it is not in the C book.  Unfortunately (some would say fortunately,
  8. I gather),  I have not yet prevailed on the proprietors of any PCC
  9. compiler, including that for the Vax, to go along.  The reasoning was that it
  10. is easy, as utzoo!henry found, to declare objects whose size, on a 16-bit
  11. machine, looks negative when interpreted as an int.  I felt that the least
  12. painful way to deal with this was to make the expression unsigned,
  13. rather than ignoring the issue altogether or making sizeof either
  14. long or short depending on its operand.
  15.  
  16. In practice, the change caused us trouble only in the one case pointed
  17. out by utah-cs!lepreau, namely
  18.     (long) -sizeof(...)
  19. It may look canonical, but as I recall it occurred only in one place
  20. (though that place was init.c!)
  21.  
  22. Finally, the code sequence produced for a[i][j] %= k  is indeed wrong
  23. in the distributed v7.  I can no longer point to the offending line,
  24. but I'm pretty sure it is an obvious lack of a 'B1' in the code
  25. tables for %=.
  26.         Dennis Ritchie
  27.