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: [ On topic, amazingtly ]: labels and declarations Date: Mon, 25 Mar 2019 13:17:35 -0700 Organization: None to speak of Lines: 35 Message-ID: References: <8gAjE.142392$tK1.4950@fx28.am4> <77b0609f-f653-45bf-ae78-f202d46e7ea7@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="784bbd8fb1c90ff7036d4663e7b2295d"; logging-data="3087"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/OZ32MU9P6jnt6tMtFOIzE" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:NNZjQ6DB+a7JUi7oMkqJreuJ80M= sha1:Ot6pB9SItisDQ6p8UpepYUyJJsE= Xref: csiph.com comp.lang.c:142436 James Kuyper writes: > On Saturday, March 23, 2019 at 2:58:05 PM UTC-4, Keith Thompson wrote: > ... >> Prior to C99, it wasn't possible to mix declarations and statements >> within a block, and it wouldn't have made much sense to allow labels >> on declarations (though I suppose it could have been permitted). > > In general, if you have any good reason to write: > > int var; > label: var=expression; > > Then it would be more convenient if we were allowed to write > > label: int var=expression; > > for precisely the same reason that would apply if "label:" were removed > entirely. That would have been true even in C90, but the relaxation of > the restrictions on initializers in C99 would have made this issue more > likely to come up. I think that the main reason this hasn't been a big > issue is the unpopularity of labels in general. Agreed. But if I wanted to write: label: int var = expression; I'd just write: label:; int var = expression; -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */