Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!pasteur!ucbvax!hplabs!hp-pcd!hpmcaa!marco From: marco@hpmcaa.HP.COM (Marco Dalla-Gasperina) Newsgroups: comp.sys.ibm.pc Subject: Re: Another msc 5.1 bug Message-ID: <200015@hpmcaa.HP.COM> Date: 4 Jan 89 16:47:40 GMT References: <139@smsdpg.uu.net> Organization: HP McMinville Division Lines: 31 / hpmcaa:comp.sys.ibm.pc / seg@smsdpg.uu.net (Scott Garfinkle) / 10:18 am Jan 3, 1989 / I just ran across a neat new (?) bug in MSC5.1: #line 1 "foo.c" fun() { extern int * const a; int * const b = a; b[0] = 1; } produces "foo.c(5) : error C2166: lval specifies 'const' object" In other words, you can't use a const pointer to a non-const chunk of memory. Scott E. Garfinkle SMS Data Products Group, Inc. smsdpg!seg@uunet.uu.net ---------- I'm not sure of this, but I remember that I was having trouble with keeping the evaluation order straight in this case... int * const a means the value (*a) is constant int const * a means the value (a) is constant int const * const a means both (a) and (*a) are constant. Seems backwards but thats what the manual says! marco