justinfrankel / reaper-sdk

REAPER C/C++ extension SDK
125 stars 20 forks source link

C compatibility errors with anonymous structs #4

Open jeremybernstein opened 2 years ago

jeremybernstein commented 2 years ago

Hi, when compiling SWS on macOS 11.6.1 with Xcode 13, I get some annoying warnings:

In file included from /Users/me/Projects/sws/reaper/reaper.cpp:31:
/Users/me/Projects/sws/vendor/reaper-sdk/sdk/reaper_plugin.h:362:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage]
typedef struct
              ^
               PCM_source_peaktransfer_t
/Users/me/Projects/sws/vendor/reaper-sdk/sdk/reaper_plugin.h:405:3: note: type is not C-compatible due to this member declaration
  static inline int extra_blocksize(int extra_requested_data_type)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/me/Projects/sws/vendor/reaper-sdk/sdk/reaper_plugin.h:417:3: note: type is given name 'PCM_source_peaktransfer_t' for linkage purposes by this typedef declaration
} PCM_source_peaktransfer_t;
  ^
1 warning generated.

It would be great if the C-style typedef struct could include the struct name to de-anonymize it and eliminate those warnings (as the warning claims, the compiler is naming the struct behind the scenes anyway).