Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!sun-barr!newstop!sun!peregrine!falk From: falk@peregrine.Sun.COM (Ed Falk) Newsgroups: comp.graphics Subject: Re: A bug in PBM software (.pcx => pbm) Message-ID: <140535@sun.Eng.Sun.COM> Date: 12 Aug 90 03:31:16 GMT References: <1990Aug7.200352.1484@ucselx.sdsu.edu> Sender: news@sun.Eng.Sun.COM Organization: Sun Microsystems, Mt. View, Ca. Lines: 29 In article <1990Aug7.200352.1484@ucselx.sdsu.edu> brian@ucselx.sdsu.edu (Brian Ho) writes: >I have find a bug (may not appear in other system) in the PBM software. >The bug is in the program which converts a .PCX (paint brush image format) >to a Pbm portable bitmap. > >The bug (very small) appear at line 102 in program "pcxtopbm.c" which is >under /pbmplus/pbm/. The orignal code read : > > if (b & 0xC0 == 0xC0) > .. > .. > >However, some system (e.g. Sun 3/50) does not like this. It miss interpret it >as > if (b & (OxCO == 0xC0) > .. > .. According to "The C Programmer's Handbook" by AT&T Bell Labs, this is the correct behavior. If you find a compiler that *doesn't* parse this way, contact the vendor immediately. (personally, I think this is the wrong order of precedence, but K&R defined it that way so that's the way it is.) -ed falk, sun microsystems -- sun!falk, falk@sun.com "What are politicians going to tell people when the Constitution is gone and we still have a drug problem?" -- William Simpson, A.C.L.U.