Is mixing char and int types as parameters portable?
Guido van Rossum
guido at mcvax.UUCP
Wed Mar 14 22:57:16 AEST 1984
I'd like to hear the opinion of the net on the following (MAIL please;
I'll summarize):
The K&R book says that chars are widened to ints before anything is
done to them (except when used as lvalue, I think). Does this mean
that the following code is portable, even to the weirdest machines?
foo(c) char c; { ... }
bar(i) int i; { ... }
main() { foo(100); bar(' '); }
(Please, no guesses -- I can GUESS it's right myself.)
Guido van Rossum, CWI, Amsterdam guido at mcvax
More information about the Comp.lang.c
mailing list