[mb-devel] Re: Ruby bindings for libdiscid

Philipp Wolfer phw at rubyforge.org
Tue Jun 5 10:32:12 UTC 2007


> I'm not sure if C99 allows you to do variable declarations in the middle
> of the code, but ANSI C doesn't. So if you want compatible C code, I'd
> suggest to move them to the begin of a function:

Thanks again, I changed the code and now it compiles without problems.

Just to summarize:
- variable declarations need to go at the beginning of a block (not
necessarily of the whole function, just a the top of their scope).
This was just what my hackish workaround did, but I didn't see the
reason for it.
- // are not ANSI C, but as well GCC as the MS compiler accept them. I
changed them anyway.
- ++ is ANSI C ;-)

-- 
Philipp Wolfer



More information about the MusicBrainz-devel mailing list