-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc++] Undeprecate POSIX STREAM macros. #88296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
LWG3869 Deprecate std::errc constants related to UNIX STREAMS deprecates the POSIX macros ENODATA, ENOSR, ENOSTR, and ETIME. These were deprecated in libc++ in llvm#80542. Based on the post commit feedback the macro are no longer deprecated. Instead libc++ leaves the deprecation to the provider of errno.h.
@llvm/pr-subscribers-libcxx Author: Mark de Wever (mordante) ChangesLWG3869 Deprecate std::errc constants related to UNIX STREAMS deprecates the POSIX macros ENODATA, ENOSR, ENOSTR, and ETIME. These were deprecated in libc++ in Full diff: https://github.com/llvm/llvm-project/pull/88296.diff 3 Files Affected:
diff --git a/libcxx/include/__system_error/errc.h b/libcxx/include/__system_error/errc.h
index e9f3656b7b9c2b..a262c856fd998f 100644
--- a/libcxx/include/__system_error/errc.h
+++ b/libcxx/include/__system_error/errc.h
@@ -112,6 +112,11 @@ enum class errc
// macros. So GCC does not need the pushing and popping.
//
// TODO Remove this when the deprecated constants are removed.
+//
+// Note based on the post-review comments in
+// https://github.com/llvm/llvm-project/pull/80542 libc++ no longer deprecates
+// the macros. Since C libraries my start to deprecate these POSIX macros the
+// disabling of the deprecated macros is not removed.
#if defined(_LIBCPP_COMPILER_CLANG_BASED)
# define _LIBCPP_SUPPRESS_DEPRECATED_ERRC_PUSH _LIBCPP_SUPPRESS_DEPRECATED_PUSH
# define _LIBCPP_SUPPRESS_DEPRECATED_ERRC_POP _LIBCPP_SUPPRESS_DEPRECATED_POP
diff --git a/libcxx/include/cerrno b/libcxx/include/cerrno
index 6171ae31f18479..81e82cf849ab00 100644
--- a/libcxx/include/cerrno
+++ b/libcxx/include/cerrno
@@ -38,17 +38,11 @@ Macros:
# pragma GCC system_header
#endif
-#ifdef ENODATA
-# pragma clang deprecated(ENODATA, "ENODATA is deprecated in ISO C++")
-#endif
-#ifdef ENOSR
-# pragma clang deprecated(ENOSR, "ENOSR is deprecated in ISO C++")
-#endif
-#ifdef ENOSTR
-# pragma clang deprecated(ENOSTR, "ENOSTR is deprecated in ISO C++")
-#endif
-#ifdef ETIME
-# pragma clang deprecated(ETIME, "ETIME is deprecated in ISO C++")
-#endif
+// LWG3869 Deprecate std::errc constants related to UNIX STREAMS
+//
+// deprecates the POSIX macros ENODATA, ENOSR, ENOSTR, and ETIME. These were
+// deprecated in libc++ in https://github.com/llvm/llvm-project/pull/80542.
+// Based on the post commit feedback the macro are no longer deprecated.
+// Instead libc++ leaves the deprecation to the provider of errno.h.
#endif // _LIBCPP_CERRNO
diff --git a/libcxx/test/std/depr.cerro/cerrno.syn.verify.cpp b/libcxx/test/std/depr.cerro/cerrno.syn.verify.cpp
deleted file mode 100644
index 3a38605570dafb..00000000000000
--- a/libcxx/test/std/depr.cerro/cerrno.syn.verify.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: clang-modules-build
-// UNSUPPORTED: apple-clang && c++03
-
-// <cerrno>
-
-// tests LWG 3869 deprecated macros.
-//
-// Note the macros may not be defined. When they are not defined the
-// ifdef XXX does not trigger a deprecated message. So use them in the
-// ifdef and test for 2 deprecated messages.
-
-#include <cerrno>
-
-#ifdef ENODATA
-[[maybe_unused]] int nodata =
- ENODATA; // [email protected]:* 2 {{macro 'ENODATA' has been marked as deprecated}}
-#endif
-#ifdef ENOSR
-[[maybe_unused]] int nosr =
- ENOSR; // [email protected]:* 2 {{macro 'ENOSR' has been marked as deprecated}}
-#endif
-#ifdef ENOSTR
-[[maybe_unused]] int nostr =
- ENOSTR; // [email protected]:* 2 {{macro 'ENOSTR' has been marked as deprecated}}
-#endif
-#ifdef ETIME
-[[maybe_unused]] int timeout =
- ETIME; // [email protected]:* 2 {{macro 'ETIME' has been marked as deprecated}}
-#endif
|
Co-authored-by: Hristo Hristov <[email protected]> Co-authored-by: Louis Dionne <[email protected]>
Thanks for the suggestions! I'll land this when the CI is green. |
LWG3869 Deprecate std::errc constants related to UNIX STREAMS deprecates the POSIX macros ENODATA, ENOSR, ENOSTR, and ETIME. These were deprecated in libc++ in llvm#80542. Based on the post commit feedback the macro are no longer deprecated. Instead libc++ leaves the deprecation to the provider of errno.h. --------- Co-authored-by: Hristo Hristov <[email protected]> Co-authored-by: Louis Dionne <[email protected]>
LWG3869 Deprecate std::errc constants related to UNIX STREAMS
deprecates the POSIX macros ENODATA, ENOSR, ENOSTR, and ETIME. These were deprecated in libc++ in
#80542. Based on the post commit feedback the macro are no longer deprecated. Instead libc++ leaves the deprecation to the provider of errno.h.