GNOME Bugzilla – Bug 580513
Delegates typedef'd before enums in generated C code -- problem if delegates use enum
Last modified: 2009-05-07 16:17:03 UTC
Please describe the problem: When compiling with 0.7.1, gcc complains whenever a delegate uses an enum as a parameter or a result value. Examining the C code, it appears delegates are typedef'd before enums, meaning they cannot reference them without a compile error. Steps to reproduce: enum TestEnum { foo, bar, xyzzy, } delegate void tdelegate(TestEnum te); void main() { } Actual results: Compile error: /home/jim/prj/test/test.c:7: error: expected ‘)’ before ‘te’ error: cc exited with status 256 Compilation failed: 1 error(s), 0 warning(s) make: *** [test] Error 1 Expected results: Compile without error. Does this happen every time? Yes. Other information:
Created attachment 133653 [details] [review] Patch I confirm as of master commit 507767eee6ab6ef3f34a5053c2cfb824d1008113. Patch emits delegate typedef statement as a type definition instead of a type declaration.
Thanks -- this does solve my problem. As a side note, I could only compile this patched 0.7.1 with an unpatched 0.7.1. 0.6.1 choked. Thanks!
commit 5207f35a645c2623a1adb55f982762b8de2eeae1 Author: Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com> Date: Thu May 7 18:15:20 2009 +0200 Move delegate typedef to right position Fixes bug 580513.