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

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-gsoc@xxxxxxxxxxxxx
  • Date: Tue, 15 Jul 2008 19:17:19 +0200

On 2008-07-14 at 14:23:02 [+0200], Rene Gollent <anevilyak@xxxxxxxxx> wrote:
> On Mon, Jul 14, 2008 at 7:19 AM, Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:
> > I don't know why that would cause problems with C files, but there's no
> > reason not to switch to C++.
> 
> Pre-C99 C disallows variable declarations anywhere other than the
> beginning of the function, and gcc 2.x at least is completely stupid
> about how it reports errors in that case.

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.

CU, Ingo

Other related posts: