Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Description
Feature or enhancement
Runtime crashes like#97897 could be prevented by turning clang'sunguaded-availability-new
warning into a fatal compile error. This can be done by adding-Werror=unguarded-availability-new
to compiler flags.
Essentially what this warning does is cross reference undefined symbols against symbols defined in the targeted Apple SDK. If it sees a symbol introduced in a newer SDK version and that symbol isn't weakly referenced/linked, you get a warning.-Werror
upconverts it to a fatal compiler error.
If you add this flag to release builds, the compiler prevents you from shipping binaries that ship unguarded symbol usage for targeted SDK versions. i.e. it prevents run-time crashes when binaries run on older Apple OS versions.
If you enable this setting today, you may find the 3.8 branch isn't properly gating use ofmkfifoat
andmknodat
. (Although this may be an oddity from python-build-standalone and not a CPython bug.)
The advantages of having this additional warning is to catch regressions such as:
- Availability of
ptsname_r
is not checked at runtime on macOS #123797 - Availability of utimensat, futimens not checked correctly on macOS #75782