In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/ncurses.h:141:
/opt/local/include/unctrl.h:60:63: error: unknown type name 'SCREEN'
NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(unctrl) (SCREEN*, chtype);
What happens is clang looks into the SDK first, finds ncurses.h in there, but that then calls into the unctrl.h in the CPATH path, and the build fails as the ncurses in the SDK is version 5, but MacPorts is version 6.
I suspect this is happening more often than just this example, but this is the one that delivers our errors.
Should clang not use the fmodules-cache if CPATH is set?
Any ideas or workarounds for us would be much appreciated.