| PLEX86 | ||
Where should the type information be 148Morten, et al, Where should the type information be 149 On Wed, 30 Mar 2005 22:38:39 -0700, Steve What do you mean by "seemingly senseless"? Right-shifting a signed value is about the... Where should the type information be 151 Andrew Reilly code others). The 2-bit combinations encode the usual meanings for arithmetic instructions: 0 = Zero, 1 = Low, 2 = High, 3 = Overflow. The interpretation does however...
There seems to be a break in communication here, and I am not sure where it is. I am NOT proposing eliminating any operators from C, only that you explicitely cast the operands of operations that are seemingly senseless, like performing a boolean operation (instesd of the corresponding logical operation) on an arithmetically computed result. Many-most implementations of C produces undefined results unique to the specific implementation for craziness like this, because boolean operations are only defined for boolean values. While the spec says that any non-zero is a true, it does NOT define exactly what non-zero result you get when manipulating boolean values, and some implementations only manipulate a few bits in their boolean operands. In any case, why not use logical operators instead, because that is what they were meant for? Even this seemingly senseless operation could be performed with a boolean operator by casting the arithmetically computed result as a boolean, just to indicate to the compiler that you really meant the craziness that you wrote. Of course, good programmers explicitely cast everything that needs it rather than leaving it up to the (unpredictable) compiler, so imposing this wouldn't even be noticed by these programmers. There would be little if any impact on debugged production code, as most of the error messages would probably be for previously undetected latent bugs. Only a few newbes and really sloppy programmers would even notice this change. Steve Richfie1d
|
||||
Where should the type information be 149 Alt Folklore Computers from Newsgroups The #1 Usenet Provider on the Internet
|
||||