This is an archive of the discontinued LLVM Phabricator instance.

[clang] Enable errors for undefined TARGET_OS_ macros in Darwin driver
ClosedPublic

Authored by zixuw on Jul 6 2020, 12:26 PM.

Details

Summary

Add clang option -Wundef-prefix=TARGET_OS_ and -Werror=undef-prefix
to Darwin driver.

Diff Detail

Event Timeline

zixuw created this revision.Jul 6 2020, 12:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2020, 12:26 PM

Please add a test-case as well.

zixuw updated this revision to Diff 275821.Jul 6 2020, 1:27 PM

Add a test case.

arphaman accepted this revision.Jul 6 2020, 1:38 PM
This revision is now accepted and ready to land.Jul 6 2020, 1:38 PM
This revision was automatically updated to reflect the committed changes.

This seems to have broken compilation for me on 10.15.

The stdio.h from the 10.15 SDK there's the following usage:

#if TARGET_OS_EMBEDDED
#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg)
#else
#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(osx_msg)
#endif

Actually, this may just be a local configuration issue.