Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Small Device C Compiler 3.6.0 released Date: Fri, 17 Jun 2016 11:51:17 -0700 Organization: None to speak of Lines: 28 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="22421"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ChNMrfwx0wNeihSTEbDDY" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:JutDgUbc8JXAvecF/2RIErfucWQ= sha1:ctJzqA7PmssqfYeWixlWMy4VKYk= Xref: csiph.com comp.lang.c:89440 BartC writes: [...] > If you start off with this: > > { > int* p; > { > int A = 77; > } > printf("*p=%d\n", *p); > } Then you have undefined behavior, because p is uninitialized. [...] > This is the sort of nonsense I object to. Just keep the 'int A' at > function scope and be done with it. Only label names have function scope. An object name defined in the outermost block of a function has block scope, and the same rules apply as for any other block. -- 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"