Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!homxb!houxm!mhuxt!mhuxm!mhuxo!ulysses!allegra!mit-eddie!rutgers!seismo!mcnc!rti!dg_rtp!meissner From: meissner@dg_rtp.UUCP Newsgroups: comp.lang.c++ Subject: Re: Why put constants on the stack? Message-ID: <2111@dg_rtp.UUCP> Date: Mon, 15-Jun-87 13:30:45 EDT Article-I.D.: dg_rtp.2111 Posted: Mon Jun 15 13:30:45 1987 Date-Received: Wed, 17-Jun-87 02:33:05 EDT References: <165700009@uiucdcsb> <354@formtek.UUCP> Reply-To: meissner@dg_rtp.UUCP (Michael Meissner) Organization: Data General (Languages @ Research Triangle Park, NC.) Lines: 23 /* somebody else from uiucdcsb */ > When a local variable is declared ``const,'' the compiler appears to > assume that it is automatic as well. > Why are ``const'' variables (other than parameters, of course) not > assumed to be static? In article <354@formtek.UUCP> kls@formtek.UUCP (Karl Swartz) writes: > In dpANSI C, const functions as a type-modifier (even though) they > don't call it that. Thus, "const int foo" has no explicit storage- > class and is therefore assumed to be automatic (within a function > definition); the "const" has no effect in this regard. > > Perhaps C++ is thinking along the same lines? Ughhhh, it was the other way around, dpANSI adopted const from C++ (and then added volatile to allow optization on memory mapped I/O). -- Michael Meissner, Data General Uucp: ...mcnc!rti!dg_rtp!meissner It is 11pm, do you know what your sendmail and uucico are doing?