Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!nosc!ucsd!ucsdhub!hp-sdd!hplabs!hpda!hpcuhb!hpcllla!hpclisp!hpclsue!sue From: sue@hpclsue.HP.COM (Sue Meloy) Newsgroups: comp.lang.c Subject: Re: `char' parameters: a follow-up/summary ( Long - but worth it :-) ) Message-ID: <660018@hpclsue.HP.COM> Date: 9 Sep 88 18:08:18 GMT References: <1626@se-sd.sandiego.ncr.com> Organization: HP NSG/ISD California Language Lab Lines: 24 Rationale, 3.7.1: Some current implementations rewrite the type of a (for instance) char parameter as if it were declared int, sice the argument is known to be passed as an int (in the absence of prototypes). The Standard requires, however, that the received argument be converted as if by assignment upon function entry. Type rewriting is thus no longer permissible. QUIET CHANGE Functions that depend on char or short parameter types being widened to int, or float to double, may behave differently. The assignment conversion for argument passing often requires no executable code. In most twos-complement machines, a short or char is a contiguous subset of the bytes comprising the int actually passed (for even the most unusual byte orderings), so that assignment conversion is effected by adjusting the address of the argument (if necessary) and rewriting its type. Draft Standard, 3.7.1: On entry to the function the value of each argument shall be converted to the type its corresponding parameter, as if by assignment to the parameter.