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)
|