Consider adding -Werror=unguarded-availability-new
to compiler flags for Apple platforms
#100384
Labels
-Werror=unguarded-availability-new
to compiler flags for Apple platforms
#100384
Feature or enhancement
Runtime crashes like #97897 could be prevented by turning clang's
unguaded-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 of
mkfifoat
andmknodat
. (Although this may be an oddity from python-build-standalone and not a CPython bug.)cc @ned-deily
The text was updated successfully, but these errors were encountered: