cbindgen icon indicating copy to clipboard operation
cbindgen copied to clipboard

`test_body` fails when using clang

Open danyspin97 opened this issue 5 years ago • 2 comments

test_body fail when using clang-11 due to -Wnon-c-typedef-for-linkage.

The following is the current cbindgen output that triggers the warning:

typedef struct {
  int32_t i;
#ifdef __cplusplus
    inline void foo();
#endif
} MyFancyStruct;

I am opening an issue because I don't know if you would prefer to fix the test or ignore the warning in tests.rs.

danyspin97 avatar Nov 29 '20 11:11 danyspin97

Huh, is that a new warning? We greened up clang tests not that long ago...

But yeah, this looks like an issue with the generated code, potentially. But since that inline void foo(); is adding via the configuration, we might want to just silence the warning, or turn the condition into something like:

#if defined(__cplusplus) && !defined(CBINDGEN_STYLE_TAG)

Or something of that sort.

emilio avatar Nov 30 '20 05:11 emilio

any update on this?

justinkb avatar May 20 '21 17:05 justinkb