Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!lll-crg!nike!cad!ucbvax!hplabs!felix!peregrine!mike From: mike@peregrine.UUCP (Mike Wexler) Newsgroups: net.lang.c Subject: Re: Error recovery (long) Message-ID: <397@peregrine.UUCP> Date: Tue, 3-Jun-86 12:54:11 EDT Article-I.D.: peregrin.397 Posted: Tue Jun 3 12:54:11 1986 Date-Received: Thu, 5-Jun-86 19:46:42 EDT References: <312@uw-nsr.UUCP> <1009@dataioDataio.UUCP> Reply-To: mike@peregrine.UUCP (Mike Wexler) Distribution: net Organization: Peregrine Systems, Irvine, Ca Lines: 22 In article <1009@dataioDataio.UUCP> bright@dataio.UUCP (Walter Bright writes: >In article <312@uw-nsr.UUCP> john@uw-nsr.UUCP (John Sambrook) writes: >>The second feature is the ability to declare certain data structures as >>"read only." This is done via a compiler switch "-R" and applies to all >>data structures that are initialized to a constant value within the >>compilation unit. >The declaration for a can be made 'read only' by declaring it as follows: > > const int a = 1; > >Doing an assignment to a will then cause a syntax error when compiling. >This is in the draft ANSI C spec. This only works if you have an ANSI C compiler. Do you? BTW, the C compiler on the SUN has a -R option that makes initialized variables shared and read-only. -- Mike Wexler Email address:(trwrb|scgvaxd)!felix!peregrine!mike Tel Co. address: (714)855-3923 ;-) Internet address: ucivax@ucbvax.BERKELY.EDU!ucivax%felix!mike@peregrine :-(