[libcxx-commits] [libcxx] [libc++] Add FreeBSD-specific EINTEGRITY errc value (PR #76364)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jan 8 10:11:50 PST 2024
https://github.com/ldionne commented:
According to its documentation, `std::errc` is intended to provide a *portable* way of referring to POSIX error codes. This extension goes against that ideal, since if you ever use `integrity_check_failed` in your code, it became non-portable (not only will it work only on FreeBSD, but it will also only work with libc++ on FreeBSD). That seems like a non-ideal situation, and I wonder whether it's really a good idea to provide that extension at all.
If someone writes code that uses `EINTEGRITY`, I would expect to see it under some platform-specific `#ifdef` and so it is probably acceptable for such code to look a bit uglier, e.g. `static_cast<int>(errc) == EINTEGRITY` instead of `errc == std::errc::integrity_check_failed`.
So overall, I am uncertain of the desirability of this extension, but of course I am happy to have my mind changed.
https://github.com/llvm/llvm-project/pull/76364
More information about the libcxx-commits
mailing list