libsc
libsc copied to clipboard
libsc introduces warnings in downstream software
Description I don't get what the purpose of this macro is, but the compiler complains that it declares a function which is never called.
In file included from /Users/adutka/hopps/tpls/t8code/sc/src/sc.h:210:
/Users/adutka/hopps/tpls/t8code/sc/src/sc_mpi.h:804:1: warning: unused function 'sc_extern_c_hack_2' [-Wunused-function]
804 | SC_EXTERN_C_END;
| ^~~~~~~~~~~~~~~
/Users/adutka/hopps/tpls/t8code/sc/src/sc.h:200:51: note: expanded from macro 'SC_EXTERN_C_END'
200 | #define SC_EXTERN_C_END } void sc_extern_c_hack_2 (void)
| ^~~~~~~~~~~~~~~~~~
To Reproduce
Compile a dummy downstream project including src/sc.h
with -Wall
enabled (Clang 17)
I don't get what the purpose of this macro is, but the compiler complains that it declares a function which is never called.
Thanks! This is a workaround to have a macro that hides the extern "C" { } braces from GNU indent, for both C and C++. We'll look into it!
Thanks for the report, indeed the hack_2 function was subtly not extern "C". Does this resolve the warning?
Resolved by #183.