Page 1 of 1

Please fix anonymous struct/union issue

Posted: Sat Jan 07, 2012 10:01 am
by azcievry
I just ported my code from chipmunk 5.3.4 to 6.0.0 , but when I finished porting the APIs and came to compile my project I got tons of errors. The problem was provoked by the new file "cpBBTree.c", within which anonymous struct/union was used and my compiler couldn't recognize that. I googled it and found anonymous struct/union is not supported by C99 standard, but acceptable by GNU99 standard. Consequently I had to use "std=gnu99" for my compiler and the issue is clear , but picking out this issue still cost me some amount of time . As anonymous struct/union is not necessary for coding I wonder if this can be viewed as a bug and fixed in some time, or as least a tip should be included in documentation to avoid wasting time solving the compiler issue. Thanks.

Re: Please fix anonymous struct/union issue

Posted: Sat Jan 07, 2012 11:36 pm
by slembcke
Update to 6.0.3, it was fixed a few minor versions ago I think. Anonymous unions/structs are fine in C++, but I didn't like relying on the GNU extension in C. Chipmunk targets the intersection of language features offered by C++ and C99 to get compatibility with MSVC as well.