home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / amiga / programm / 17403 < prev    next >
Encoding:
Text File  |  1992-12-15  |  1.5 KB  |  39 lines

  1. Organization: Carnegie Mellon, Pittsburgh, PA
  2. Path: sparky!uunet!cis.ohio-state.edu!news.sei.cmu.edu!fs7.ece.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!<UNAUTHENTICATED>+
  3. Newsgroups: comp.sys.amiga.programmer
  4. Message-ID: <8f=bT9K00hsBMrjYoD@cs.cmu.edu>
  5. Date: Tue, 15 Dec 1992 19:26:49 -0500 
  6. From: Michael Witbrock <mjw+@cs.cmu.edu>
  7. Subject: Re: Bug in SAS/C V6.1?
  8. In-Reply-To: <1992Dec15.003553.23198@oracle.us.oracle.com>
  9. References: <S37732V.92Dec11104414@lk-hp-12.hut.fi> <Bz3nvr.82D@unx.sas.com>
  10.     <1992Dec15.003553.23198@oracle.us.oracle.com>
  11. Distribution: comp
  12. Lines: 25
  13.  
  14. Excerpts from netnews.comp.sys.amiga.programmer: 15-Dec-92 Re: Bug in
  15. SAS/C V6.1? David Navas@oracle.uucp (1594)
  16.  
  17. > >>SAS/C gives me a warning in a line containg ~0, saying something
  18. > >>like that I can`t init unsigned short to -1. Okey, I understand that
  19. > >>it ~0 means the same as -1 but if I have wanted to use signed numbers
  20. > >>I would have specified it as -1.
  21.  
  22. > >This is just the compiler trying to keep you out of trouble.  :-)
  23.  
  24. > I'd like to go on record as saying that this sucks :)
  25.  
  26. Really, ~0 is NOT the same thing as -1.
  27.  
  28. That depends on the type of  0.   If 0 is defined as a signed int, and
  29. the machine is an amiga, then it's the same, and it can demand that you
  30. do ~(unsigned short)0 .
  31. However, if this is the case, then it shouldn't let you do  unsigned int
  32. x = 5; either
  33.  
  34. I'd tend to agree that this optimisation (~0 == -1) is producing the
  35. wrong results, and if it can't stop making the warning, it should
  36. evaluate the ~ at runtime.
  37.  
  38. michael
  39.