TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: All
from: Paul Edwards
date: 1996-07-05 00:20:06
subject: unsigned preserving

There was one thing that was changed from K&R C to ANSI C that changed
the language definition.  Unfortunately I cannot remember what it was, but
I do remember it went under the name "unsigned preserving". 
IBM's C compiler for MVS had an option "unspr" or something which
changed their nominally-ANSI C compiler to use the old logic, which was
unsigned preserving.

This comes up now because I got a compiler warning from Sun's acc compiler
for SunOS telling me to use an explicit cast to avoid ambiguity.

The code was along the lines of:

if (unsigned-char + integer > unsigned-char) ...

Actually, the warning it gave was that ">" was ambiguous.

I have a THEORY that under K&R C, the above would have converted all
variables in the equation to unsigned integer, whereas in ANSI C, all
variables would be converted to integer.

Anyone have any info about any of this?  I would obviously like the warning
to go away, but I don't really know what "I" have done wrong. 
BFN.  Paul.
@EOT:

---
* Origin: X (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.