Article View: gnu.gcc.bug
Article #1056Re: Bug in cygnus 2.0.1 (2.1 and 2.2.2 of mainstream)
From: Robert Earl
Date: Thu, 03 Sep 1992 11:00
Date: Thu, 03 Sep 1992 11:00
30 lines
1634 bytes
1634 bytes
system@kryton.UUCP (Scott Beckstead) writes: | Yet in the file rtl.c There is a code fragment that | looks like this | if(!strcmp(somevalue,someothervalue)) | someaction; | This seems like a particularly BAD idea considering the values returned by | this fully ansi compliant library (yes it does change the behavior of | the programs) I have modified my library to fix this but the code | really should be fixed so that a unary not of a non boolean return | is not used as a boolean. Because with the value -1 I'm sure you see the | problem. (!(-1) is 0 but !(1) is -2 and !(0) is -1) What on earth are you talking about? The "!" operator NEVER returns ANYTHING but 0 or 1. Maybe you're thinking about the "~" operator. | I beleive the intent of this code to be: | if(!(strcmp(somevalue,someothervalue) == 0)) | someaction; Well, you're wrong, and you've just introduced a bug. -- "If you've got a pig that likes jumping fences, | robert earl you have to make its fence a lot higher all at | rearl@ucsd.edu once -- if you do it by increments, all you're | rearl@piggy.ucsb.edu doing is training a jumping pig." -Henry Spencer|
Technical Details
Message-ID:
<chupchup.715518046@piggy>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!ferkel.ucsb.edu!chupchupReferences:
<X3NgqB3w164w@kryton.UUCP>Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!ferkel.ucsb.edu!chupchup From: chupchup@ferkel.ucsb.edu (Robert Earl) Subject: Re: Bug in cygnus 2.0.1 (2.1 and 2.2.2 of mainstream) Message-ID: <chupchup.715518046@piggy> Sender: gnulists@ai.mit.edu Organization: (EVIL!) References: <X3NgqB3w164w@kryton.UUCP> Distribution: gnu Date: Thu, 3 Sep 1992 11:00:46 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 31