I'm using FreeBSD and I have a similar problem. The simplest way to get rid of these warnings is to compile your dependent program with -Wno-return-type
or more specifically, with -Wno-return-type-c-linkage
flag, which suppresses these warnings.
Other than that, you can patch the headers.