[haiku-gsoc] Re: Xsi semaphorses: patch #1

On 2008-07-15 at 19:52:28 [+0200], Rene Gollent <anevilyak@xxxxxxxxx> wrote:
> On Tue, Jul 15, 2008 at 12:17 PM, Ingo Weinhold <ingo_weinhold@xxxxxx> 
> wrote:
> > Actually variable declarations are allowed at the beginning of every 
> > block,
> > which is respected in this case. It seems that the gcc-specific __typeof()
> > feature doesn't work in C, though. Which pretty much defeats the purpose 
> > of
> > using it, since for C++ I could have used an inline template function 
> > instead.
> 
> Not with C89, try for yourself :) It fails even without using that
> macro, just try to declare a variable someplace after having written a
> non-decl line of code.

I'm not particularly familiar with the different C versions, but I'm sure 
that whatever is the default in gcc 2.95.3 (or 2.9) allows variable 
declarations at the beginning of any block. I.e. "do { int v; } while 
(false);" is perfectly allowed.

CU, Ingo

Other related posts: