Error recovery (long)
Mike Wexler
mike at peregrine.UUCP
Wed Jun 4 02:54:11 AEST 1986
In article <1009 at dataioDataio.UUCP> bright at dataio.UUCP (Walter Bright writes:
>In article <312 at uw-nsr.UUCP> john at 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 at ucbvax.BERKELY.EDU!ucivax%felix!mike at peregrine :-(
More information about the Comp.lang.c
mailing list