Skip to content

Commit f8ffcbf

Browse files
derekmauronetkex
authored andcommitted
Remove deprecated errno constants from the absl::Status mapping
ENOSTR, ETIME, ENODATA, and ENOSR are deprecated by POSIX and C++23. This change also turns on the deprecation warnings used by Chromium. See also: https://wg21.link/LWG3869 llvm/llvm-project#80542 https://buganizer.corp.google.com/issues/331100926 PiperOrigin-RevId: 619551374 Change-Id: Ica8d5008cbee52ce88d58a1fcb79dbe794045bae
1 parent 2e4ae78 commit f8ffcbf

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

absl/copts/GENERATED_AbseilCopts.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ list(APPEND ABSL_LLVM_FLAGS
8888
"-Wcast-qual"
8989
"-Wconversion"
9090
"-Wdead-code-aggressive"
91+
"-Wdeprecated-pragma"
9192
"-Wfloat-overflow-conversion"
9293
"-Wfloat-zero-conversion"
9394
"-Wfor-loop-analysis"
@@ -128,6 +129,7 @@ list(APPEND ABSL_LLVM_TEST_FLAGS
128129
"-Wcast-qual"
129130
"-Wconversion"
130131
"-Wdead-code-aggressive"
132+
"-Wdeprecated-pragma"
131133
"-Wfloat-overflow-conversion"
132134
"-Wfloat-zero-conversion"
133135
"-Wfor-loop-analysis"

absl/copts/GENERATED_copts.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ ABSL_LLVM_FLAGS = [
8989
"-Wcast-qual",
9090
"-Wconversion",
9191
"-Wdead-code-aggressive",
92+
"-Wdeprecated-pragma",
9293
"-Wfloat-overflow-conversion",
9394
"-Wfloat-zero-conversion",
9495
"-Wfor-loop-analysis",
@@ -129,6 +130,7 @@ ABSL_LLVM_TEST_FLAGS = [
129130
"-Wcast-qual",
130131
"-Wconversion",
131132
"-Wdead-code-aggressive",
133+
"-Wdeprecated-pragma",
132134
"-Wfloat-overflow-conversion",
133135
"-Wfloat-zero-conversion",
134136
"-Wfor-loop-analysis",

absl/copts/copts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"-Wcast-qual",
4949
"-Wconversion",
5050
"-Wdead-code-aggressive",
51+
"-Wdeprecated-pragma",
5152
"-Wfloat-overflow-conversion",
5253
"-Wfloat-zero-conversion",
5354
"-Wfor-loop-analysis",

absl/status/status.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,12 @@ StatusCode ErrnoToStatusCode(int error_number) {
273273
case EFAULT: // Bad address
274274
case EILSEQ: // Illegal byte sequence
275275
case ENOPROTOOPT: // Protocol not available
276-
case ENOSTR: // Not a STREAM
277276
case ENOTSOCK: // Not a socket
278277
case ENOTTY: // Inappropriate I/O control operation
279278
case EPROTOTYPE: // Protocol wrong type for socket
280279
case ESPIPE: // Invalid seek
281280
return StatusCode::kInvalidArgument;
282281
case ETIMEDOUT: // Connection timed out
283-
case ETIME: // Timer expired
284282
return StatusCode::kDeadlineExceeded;
285283
case ENODEV: // No such device
286284
case ENOENT: // No such file or directory
@@ -339,9 +337,7 @@ StatusCode ErrnoToStatusCode(int error_number) {
339337
case EMLINK: // Too many links
340338
case ENFILE: // Too many open files in system
341339
case ENOBUFS: // No buffer space available
342-
case ENODATA: // No message is available on the STREAM read queue
343340
case ENOMEM: // Not enough space
344-
case ENOSR: // No STREAM resources
345341
#ifdef EUSERS
346342
case EUSERS: // Too many users
347343
#endif

0 commit comments

Comments
 (0)