Return to BSD News archive
Path: sserve!manuel.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!gatech!enterpoop.mit.edu!ai-lab!hal.gnu.ai.mit.edu!mycroft From: mycroft@hal.gnu.ai.mit.edu (Charles Hannum) Newsgroups: comp.os.386bsd.bugs Subject: Re: cvs 1.3 bugfix Date: 8 Mar 1993 18:52:29 GMT Organization: /etc/organization Lines: 37 Message-ID: <1ng4ldINNhb5@life.ai.mit.edu> References: <SOMMERFELD.93Mar3180839@blatt.apollo.hp.com> <RICH.93Mar3233616@omicron.Rice.edu> <CGD.93Mar4170821@eden.CS.Berkeley.EDU> NNTP-Posting-Host: hal.ai.mit.edu In article <CGD.93Mar4170821@eden.CS.Berkeley.EDU> cgd@eden.CS.Berkeley.EDU (Chris G. Demetriou) writes: > > Keith made a convincing argument for the macro as-it-stands -- Just one paragraph from POSIX.1 is relevant here: 3.3.3.3 Returns. Upon successful completion, the sigismember() function returns a value of one if the specified signal is a member of the specified set, or a value of zero if it is not. [...] For all of the above functions, if an error is detected, a value of -1 is returned and errno is set to indicate the error. and one from ANSI C: 3.3.7 Bitwise shift operators Semantics [...] If the value of the right operand is negative or is greater than or equal to the width in bits of the promoted left operand, the behavior is undefined. The macro, as written, relies on C shifting always making `1<<N', where N is larger than the integer size, return 0. This is clearly wrong. It will return incorrect results if the second argument is too large. Whether it returns 0 or -1 in this case, I do not care, though -1 would be logical. -- Say `HELL NO!' to unfounded flamage. -- \ / Charles Hannum, mycroft@ai.mit.edu /\ \ PGP public key available on request. MIME, AMS, NextMail accepted. Scheme White heterosexual atheist male (WHAM) pride!