Closed pchickey closed 10 years ago
Good catch. Both are fine, but a compiler should catch this. And strictly speaking, the return should be (). I think that for some reason when a function returns () it is compiled in C as if it returns int32 and that int32 is not used. If you look at csrc/ext_arr.c, this is what happens, and the return is ignored. I think we should leave the declaration returning (), as the output should not be used, and fix the error catching.
Thanks - I'll fix externals.blk myself and leave it up to someone else to look into the compiler.
The C compiler could have caught this issue except that the int and int32 sizes are the same on this platform, so multiple declarations of the same symbol is not reported.
See also #51.
In
lib/externals.blk
the functionscopy_complex16
,copy_complex32
,copy_int16
, andcopy_int32
are each declared twice - in lines 134-137 and again in lines 143-146, with different signatures - the first set returns (), the second set returns int.I assume only one of these sets of declarations is correct. Which one?
(I don't know enough about the blk language but perhaps it should also be a bug that this wasn't caught statically.)