Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: "...the value becomes,indeterminate each time the declaration is reached" Date: Tue, 05 Feb 2019 13:14:19 -0800 Organization: None to speak of Lines: 26 Message-ID: References: <5c51d4fb.236542547@news.xmission.com> <20190201132441.0b099e5f38fdb72371bc44f0@g{oogle}mail.com> <20190204120834.7d3f84f25052b6a8315f693a@g{oogle}mail.com> <4c59dca0-2449-4234-a935-b6d604088caf@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="c751bb406372f7f708f17c4c98ab1fae"; logging-data="17050"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18npof3JdGW/vbuRVWzgAlF" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:QFKRrwBGH1zVOpm9NQAfLEc8iXU= sha1:1oHgK5pqHgj6miW+3N+D4GedWX0= Xref: csiph.com comp.lang.c:140581 Malcolm McLean writes: > On Tuesday, 5 February 2019 19:23:26 UTC, Ian Collins wrote: >> You are being willfully obtuse, const in C++ is a significant >> improvement over const in C. >> > It's significantly more complex. > > It's no longer true, as it is in C, that a correct program cannot > be turned into an incorrect program by const-qualifying or const- > dequalifying identifiers. Can you clarify what you mean by that? I can turn this correct program: int main(void) { int n = 10; n = 20; } into an incorrect program by const-qualifying n. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */