From owner-freebsd-chat Tue Mar 16 22:40:57 1999 Delivered-To: freebsd-chat@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id BC39215122 for ; Tue, 16 Mar 1999 22:40:32 -0800 (PST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony [10.0.0.6]) by rover.village.org (8.9.3/8.6.6) with ESMTP id GAA81501; Wed, 17 Mar 1999 06:40:13 GMT Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id XAA07832; Tue, 16 Mar 1999 23:40:01 -0700 (MST) Message-Id: <199903170640.XAA07832@harmony.village.org> To: dyson@iquest.net Subject: Re: Use of "register" in code Cc: alk@pobox.com, chat@FreeBSD.ORG In-reply-to: Your message of "Wed, 17 Mar 1999 01:32:13 EST." <199903170632.BAA03094@y.dyson.net> References: <199903170632.BAA03094@y.dyson.net> Date: Tue, 16 Mar 1999 23:40:01 -0700 From: Warner Losh Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org In message <199903170632.BAA03094@y.dyson.net> "John S. Dyson" writes: : Warner Losh said: : > In message <14063.12923.464399.183283@avalon.east> Anthony Kimball writes: : > : Firstly, removing "register" declarations from a program can : > : cause correct code to become incorrect code. This is true, not only : > : of ANSI C, but of the GNU C 2 series compilers, as well as other : > : significant current compilers, such as Microsoft and SunPro. : > : > How? I can think of no way that removing the register part of a : > declaration can cause this (eg register int foo -> int foo). : > : It is possible because of setjmp type things. However, the use of : register can be replaced by "auto?" Aren't those value indeterminate, even in the face of regsiter? Reliance on those values would make the program not strictly conforming. From the setjmp man page: All accessible objects have values as of the time longjmp() routine was called, except that the values of objects of automatic storage invocation duration that do not have the volatile type and have been changed between the setjmp() invocation and longjmp() call are indeterminate. Having something be register or not doesn't impact if it is automatic storage or not, unless I've misread the standard. In fact, all register variables are, by definition, automatic since that is the only type you can apply register to. I'm sure the better language lawyers will correct me if I'm wrong. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message