Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: A Note on Readability Date: Mon, 25 May 2015 13:11:35 -0700 Organization: None to speak of Lines: 40 Message-ID: <87382ko1s8.fsf@kst-u.example.com> References: <1d72d1ba-3317-4725-bedd-698843ca9c35@googlegroups.com> <85343d47-257a-4403-9672-40991134ba13@googlegroups.com> <55587201.6548218@news.xs4all.nl> <67b5daac-4378-458c-a6d0-fbf4e20d8340@googlegroups.com> <29103fb2-ce27-4c7f-a189-8ff170f5e246@googlegroups.com> <555A2A66.1040201@verizon.net> <70adeda1-3b83-4a96-b57b-59ac062f0bc6@googlegroups.com> <87oalg2zq0.fsf@kst-u.example.com> <792ce9c8-075c-4b19-8a2f-ac75dab1a178@googlegroups.com> <87y4kj1667.fsf@kst-u.example.com> <87h9r5u97m.fsf@kst-u.example.com> <5218fb08-39ea-4b78-9e14-5d946aade48c@googlegroups.com> <878ucgsau6.fsf@kst-u.example.com> <7b99e2eb-6b33-4ad4-b4a6-647a44d1e181@googlegroups.com> <87617jq7uk.fsf@kst-u.example.com> <78c97d0b-fd34-41ed-aa2b-fe31a4ab393c@googlegroups.com> <87a8wtpv8a.fsf@kst-u.example.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="9be37d943435275679235b07c7947eef"; logging-data="16147"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/QkASqFosKCG+0F5w/qxtq" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:Ohdf2lun5vZDctxX4h18XgNqLaw= sha1:j/3gApch25IfmRr+JGwpi2zJ/Fg= Xref: csiph.com comp.lang.c:62615 David Kleinecke writes: [...] > Where do you imagine identifier reservation is tested? > > In my model of compilers it could be tested in the tokenizer. So that > the moment the tokenizer reads in _GeditTab the whole compilation goes > implementor dependent. > > The preprocesor and the parser are other possibilities. Why do you imagine it needs to be tested? It doesn't. A program that defines a reserved identifier has undefined behavior. There is no requirement for this to be detected or diagnosed. As it happens, most implementations do not distinguish between reserved and unreserved identifiers. If I write int main(void) { int __Reserved = 0; return __Reserved; } my program has undefined behavior. If the implementation I'm using doesn't happen to use the name __Reserved, it will *probably* treat it as an ordinary identifier, and my program will *probably* behave identically to a program that uses "foo" rather than "__Reserved". A compiler *may* diagnose, or even reject, code that misuses reserved identifiers, but it's not required, and I don't know of any compilers that do so. You suggest that "the whole compilation goes implementor dependent". What do you imagine that means? -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"