Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!ll-xn!mit-eddie!killer!pollux!dalsqnt!rpp386!jfh From: jfh@rpp386.UUCP (John F. Haugh II) Newsgroups: comp.lang.c Subject: Re: Shifting question Message-ID: <4245@rpp386.UUCP> Date: 22 Jul 88 00:42:17 GMT References: <705@bnr-rsc.UUCP> <11556@steinmetz.ge.com> <60290@sun.uucp> <1818@spar.SPAR.SLB.COM> <11592@steinmetz.ge.com> Reply-To: jfh@rpp386.UUCP (The Beach Bum) Organization: Big "D" Home for Wayward Hackers Lines: 19 In article <11592@steinmetz.ge.com> davidsen@crdos1.UUCP (bill davidsen) writes: > If I sound really disgusted about this, I am. Compilers on brain >damaged hardware should work correctly. i have to disagree. the only way to inform the compiler that the shift will always be by a positive amount is to cast the shift count to an unsigned and the only way to inform the compiler the value is in range is to have subranges ala pascal. C does not have subranges as pascal has and expecting bounds checking on all shift operations seems to deviate from the standard C idiom of little or no run time checking. C does not check array bounds, even where it is possible, and it should not be forced to check shift counts. - john. -- John F. Haugh II +--------- Cute Chocolate Quote --------- HASA, "S" Division | "USENET should not be confused with UUCP: killer!rpp386!jfh | something that matters, like CHOCOLATE" DOMAIN: jfh@rpp386.uucp | -- with my apologizes