Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utcsstat.UUCP Path: utzoo!utcsrgv!utcsstat!geoff From: geoff@utcsstat.UUCP Newsgroups: net.lang.c Subject: Re: Signed bit fields Message-ID: <855@utcsstat.UUCP> Date: Fri, 12-Aug-83 18:54:55 EDT Article-I.D.: utcsstat.855 Posted: Fri Aug 12 18:54:55 1983 Date-Received: Sat, 13-Aug-83 01:19:50 EDT References: <1945@utcsrgv.UUCP> Organization: U. of Toronto, Canada Lines: 18 Despite the tutorial discussion on p. 138 of Kernighan & Ritchie, which says ``fields are unsigned'', appendix A, the C reference manual, says in section 8.5 on p. 197: The language does not restrict the types of things that are declared as fields, but implementations are not required to support any but integer fields. Moreover, even int fields may be considered to be unsigned. On the PDP-11, fields are not signed and have only integer values. Thus one is only guaranteed that unsigned fields will be available in a given implementation, but there may be int or even other fields. In portable code, one must not assume the existence of fields other than unsigned fields. When in doubt, read the manual, not the tutorial. Geoff Collyer, U. of Toronto