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