libsc icon indicating copy to clipboard operation
libsc copied to clipboard

libsc introduces warnings in downstream software

Open dutkalex opened this issue 9 months ago • 1 comments

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)

dutkalex avatar May 04 '24 11:05 dutkalex

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!

cburstedde avatar May 05 '24 16:05 cburstedde

Thanks for the report, indeed the hack_2 function was subtly not extern "C". Does this resolve the warning?

cburstedde avatar May 13 '24 10:05 cburstedde

Resolved by #183.

cburstedde avatar May 17 '24 05:05 cburstedde