quiet / libcorrect

C library for Convolutional codes and Reed-Solomon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

missing symbols of inline functions

piotrszulcaptiv opened this issue · comments

Hi,
Another issue we have found: when compiling without optimization the compiler complains about missing symbols that are defined in metric.h. Shouldn't these be defined in the .c file?

Piotr Szulc

Which compiler? What's the warning?

It looks like those functions should be static inline, not just inline.

The compiler was clang.

I don't have the build log right now, but the linker error was simply as if the functions were defined but not implemented. I solved this by moving the implementation to .c file (but of course they are no longer inline). Seems like this is the same issue:
https://stackoverflow.com/questions/16740515/simple-c-inline-linker-error
http://clang.llvm.org/compatibility.html#inline

Thanks for the report. I was able to reproduce and believe I have now fixed it. I'm actually surprised it worked in higher optimization levels.

For performance reasons, it's fairly important those metrics be defined inline. I could just put them in the decoder file, but this allows the code to be shared, and the separation feels a little cleaner.