[gcc r17-3099] libstdc++: Deprecate std::errc constants related to UNIX STREAMS.
Tomasz Kaminski
tkaminsk@gcc.gnu.org
Fri Aug 7 12:16:46 GMT 2026
https://gcc.gnu.org/g:d36cc0e6c3c6941db738323dd8ff62cd7fa2825c
commit r17-3099-gd36cc0e6c3c6941db738323dd8ff62cd7fa2825c
Author: Tomasz Kamiński <tkaminsk@redhat.com>
Date: Thu Aug 6 13:46:06 2026 +0200
libstdc++: Deprecate std::errc constants related to UNIX STREAMS.
Add _GLIBCXX23_DEPRECATED attribute to no_message_available,
no_stream_resources, not_a_stream, stream_timeout, per LWG3869,
"Deprecate std::errc constants related to UNIX STREAMS".
The config/os/mingw32/error_constants.h does not define any
of above enumerators (they definitions are commented out).
libstdc++-v3/ChangeLog:
* config/os/djgpp/error_constants.h (errc::no_message_available)
(errc::no_stream_resources, errc:not_a_stream)
(errc::stream_timeout): Mark as _GLIBCXX23_DEPRECATED
* config/os/generic/error_constants.h
(errc::no_message_available, errc::no_stream_resources)
(errc:not_a_stream, errc::stream_timeout): Likewise.
* config/os/mingw32-w64/error_constants.h
(errc::no_message_available, errc::no_stream_resources)
(errc:not_a_stream, errc::stream_timeout): Likewise.
* testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc:
Add dg-warning attributes for expected deprecation warnings.
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
Diff:
---
libstdc++-v3/config/os/djgpp/error_constants.h | 8 ++++----
libstdc++-v3/config/os/generic/error_constants.h | 8 ++++----
libstdc++-v3/config/os/mingw32-w64/error_constants.h | 8 ++++----
.../19_diagnostics/headers/system_error/errc_std_c++0x.cc | 8 ++++----
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/libstdc++-v3/config/os/djgpp/error_constants.h b/libstdc++-v3/config/os/djgpp/error_constants.h
index 25d702a9b68c..217b9fb007dc 100644
--- a/libstdc++-v3/config/os/djgpp/error_constants.h
+++ b/libstdc++-v3/config/os/djgpp/error_constants.h
@@ -93,7 +93,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
no_lock_available = ENOLCK,
#ifdef ENODATA
- no_message_available = ENODATA,
+ no_message_available _GLIBCXX23_DEPRECATED = ENODATA,
#endif
// no_message = ENOMSG,
@@ -101,7 +101,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
no_space_on_device = ENOSPC,
#ifdef ENOSR
- no_stream_resources = ENOSR,
+ no_stream_resources _GLIBCXX23_DEPRECATED = ENOSR,
#endif
no_such_device_or_address = ENXIO,
@@ -112,7 +112,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// not_a_socket = ENOTSOCK,
#ifdef ENOSTR
- not_a_stream = ENOSTR,
+ not_a_stream _GLIBCXX23_DEPRECATED = ENOSTR,
#endif
// not_connected = ENOTCONN,
@@ -152,7 +152,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif
#ifdef ETIME
- stream_timeout = ETIME,
+ stream_timeout _GLIBCXX26_DEPRECATED = ETIME,
#endif
#ifdef ETXTBSY
diff --git a/libstdc++-v3/config/os/generic/error_constants.h b/libstdc++-v3/config/os/generic/error_constants.h
index d574455ed3b6..c1c8aed251b5 100644
--- a/libstdc++-v3/config/os/generic/error_constants.h
+++ b/libstdc++-v3/config/os/generic/error_constants.h
@@ -93,7 +93,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
no_lock_available = ENOLCK,
#ifdef ENODATA
- no_message_available = ENODATA,
+ no_message_available _GLIBCXX23_DEPRECATED = ENODATA,
#endif
no_message = ENOMSG,
@@ -101,7 +101,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
no_space_on_device = ENOSPC,
#ifdef ENOSR
- no_stream_resources = ENOSR,
+ no_stream_resources _GLIBCXX23_DEPRECATED = ENOSR,
#endif
no_such_device_or_address = ENXIO,
@@ -112,7 +112,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
not_a_socket = ENOTSOCK,
#ifdef ENOSTR
- not_a_stream = ENOSTR,
+ not_a_stream _GLIBCXX23_DEPRECATED = ENOSTR,
#endif
not_connected = ENOTCONN,
@@ -152,7 +152,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif
#ifdef ETIME
- stream_timeout = ETIME,
+ stream_timeout _GLIBCXX23_DEPRECATED = ETIME,
#endif
#ifdef ETXTBSY
diff --git a/libstdc++-v3/config/os/mingw32-w64/error_constants.h b/libstdc++-v3/config/os/mingw32-w64/error_constants.h
index a6e68457fe8f..f2a4fb579042 100644
--- a/libstdc++-v3/config/os/mingw32-w64/error_constants.h
+++ b/libstdc++-v3/config/os/mingw32-w64/error_constants.h
@@ -90,7 +90,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif
no_lock_available = ENOLCK,
#ifdef ENODATA
- no_message_available = ENODATA,
+ no_message_available _GLIBCXX23_DEPRECATED = ENODATA,
#endif
#ifdef ENOMSG
no_message = ENOMSG,
@@ -100,7 +100,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
no_space_on_device = ENOSPC,
#endif
#ifdef ENOSR
- no_stream_resources = ENOSR,
+ no_stream_resources _GLIBCXX23_DEPRECATED = ENOSR,
#endif
no_such_device_or_address = ENXIO,
no_such_device = ENODEV,
@@ -109,7 +109,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
not_a_directory = ENOTDIR,
not_a_socket = ENOTSOCK,
#ifdef ENOSTR
- not_a_stream = ENOSTR,
+ not_a_stream _GLIBCXX23_DEPRECATED = ENOSTR,
#endif
not_connected = ENOTCONN,
not_enough_memory = ENOMEM,
@@ -139,7 +139,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
state_not_recoverable = ENOTRECOVERABLE,
#endif
#ifdef ETIME
- stream_timeout = ETIME,
+ stream_timeout _GLIBCXX23_DEPRECATED = ETIME,
#endif
#ifdef ETXTBSY
text_file_busy = ETXTBSY,
diff --git a/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc
index b5b085e28b2d..1b1a950c2b0b 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc
@@ -82,7 +82,7 @@ void test01()
TEST_ERRC(no_lock_available);
#ifdef ENODATA
- TEST_ERRC(no_message_available);
+ TEST_ERRC(no_message_available); // { dg-warning "deprecated" "" { target c++23 } }
#endif
#ifdef ENOMSG
@@ -95,7 +95,7 @@ void test01()
#endif
#ifdef ENOSR
- TEST_ERRC(no_stream_resources);
+ TEST_ERRC(no_stream_resources); // { dg-warning "deprecated" "" { target c++23 } }
#endif
TEST_ERRC(no_such_device_or_address);
@@ -106,7 +106,7 @@ void test01()
TEST_ERRC(not_a_socket);
#ifdef ENOSTR
- TEST_ERRC(not_a_stream);
+ TEST_ERRC(not_a_stream); // { dg-warning "deprecated" "" { target c++23 } }
#endif
TEST_ERRC(not_connected);
@@ -153,7 +153,7 @@ void test01()
#endif
#ifdef ETIME
- TEST_ERRC(stream_timeout);
+ TEST_ERRC(stream_timeout); // { dg-warning "deprecated" "" { target c++23 } }
#endif
#ifdef ETXTBSY
More information about the Libstdc++-cvs
mailing list