Commit e8b549b7 by Derek Mauro Committed by Copybara-Service

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
https://github.com/llvm/llvm-project/pull/80542
https://buganizer.corp.google.com/issues/331100926

PiperOrigin-RevId: 619551374
Change-Id: Ica8d5008cbee52ce88d58a1fcb79dbe794045bae
parent b70ad841
...@@ -88,6 +88,7 @@ list(APPEND ABSL_LLVM_FLAGS ...@@ -88,6 +88,7 @@ list(APPEND ABSL_LLVM_FLAGS
"-Wcast-qual" "-Wcast-qual"
"-Wconversion" "-Wconversion"
"-Wdead-code-aggressive" "-Wdead-code-aggressive"
"-Wdeprecated-pragma"
"-Wfloat-overflow-conversion" "-Wfloat-overflow-conversion"
"-Wfloat-zero-conversion" "-Wfloat-zero-conversion"
"-Wfor-loop-analysis" "-Wfor-loop-analysis"
...@@ -128,6 +129,7 @@ list(APPEND ABSL_LLVM_TEST_FLAGS ...@@ -128,6 +129,7 @@ list(APPEND ABSL_LLVM_TEST_FLAGS
"-Wcast-qual" "-Wcast-qual"
"-Wconversion" "-Wconversion"
"-Wdead-code-aggressive" "-Wdead-code-aggressive"
"-Wdeprecated-pragma"
"-Wfloat-overflow-conversion" "-Wfloat-overflow-conversion"
"-Wfloat-zero-conversion" "-Wfloat-zero-conversion"
"-Wfor-loop-analysis" "-Wfor-loop-analysis"
......
...@@ -89,6 +89,7 @@ ABSL_LLVM_FLAGS = [ ...@@ -89,6 +89,7 @@ ABSL_LLVM_FLAGS = [
"-Wcast-qual", "-Wcast-qual",
"-Wconversion", "-Wconversion",
"-Wdead-code-aggressive", "-Wdead-code-aggressive",
"-Wdeprecated-pragma",
"-Wfloat-overflow-conversion", "-Wfloat-overflow-conversion",
"-Wfloat-zero-conversion", "-Wfloat-zero-conversion",
"-Wfor-loop-analysis", "-Wfor-loop-analysis",
...@@ -129,6 +130,7 @@ ABSL_LLVM_TEST_FLAGS = [ ...@@ -129,6 +130,7 @@ ABSL_LLVM_TEST_FLAGS = [
"-Wcast-qual", "-Wcast-qual",
"-Wconversion", "-Wconversion",
"-Wdead-code-aggressive", "-Wdead-code-aggressive",
"-Wdeprecated-pragma",
"-Wfloat-overflow-conversion", "-Wfloat-overflow-conversion",
"-Wfloat-zero-conversion", "-Wfloat-zero-conversion",
"-Wfor-loop-analysis", "-Wfor-loop-analysis",
......
...@@ -48,6 +48,7 @@ ABSL_LLVM_FLAGS = [ ...@@ -48,6 +48,7 @@ ABSL_LLVM_FLAGS = [
"-Wcast-qual", "-Wcast-qual",
"-Wconversion", "-Wconversion",
"-Wdead-code-aggressive", "-Wdead-code-aggressive",
"-Wdeprecated-pragma",
"-Wfloat-overflow-conversion", "-Wfloat-overflow-conversion",
"-Wfloat-zero-conversion", "-Wfloat-zero-conversion",
"-Wfor-loop-analysis", "-Wfor-loop-analysis",
......
...@@ -273,14 +273,12 @@ StatusCode ErrnoToStatusCode(int error_number) { ...@@ -273,14 +273,12 @@ StatusCode ErrnoToStatusCode(int error_number) {
case EFAULT: // Bad address case EFAULT: // Bad address
case EILSEQ: // Illegal byte sequence case EILSEQ: // Illegal byte sequence
case ENOPROTOOPT: // Protocol not available case ENOPROTOOPT: // Protocol not available
case ENOSTR: // Not a STREAM
case ENOTSOCK: // Not a socket case ENOTSOCK: // Not a socket
case ENOTTY: // Inappropriate I/O control operation case ENOTTY: // Inappropriate I/O control operation
case EPROTOTYPE: // Protocol wrong type for socket case EPROTOTYPE: // Protocol wrong type for socket
case ESPIPE: // Invalid seek case ESPIPE: // Invalid seek
return StatusCode::kInvalidArgument; return StatusCode::kInvalidArgument;
case ETIMEDOUT: // Connection timed out case ETIMEDOUT: // Connection timed out
case ETIME: // Timer expired
return StatusCode::kDeadlineExceeded; return StatusCode::kDeadlineExceeded;
case ENODEV: // No such device case ENODEV: // No such device
case ENOENT: // No such file or directory case ENOENT: // No such file or directory
...@@ -339,9 +337,7 @@ StatusCode ErrnoToStatusCode(int error_number) { ...@@ -339,9 +337,7 @@ StatusCode ErrnoToStatusCode(int error_number) {
case EMLINK: // Too many links case EMLINK: // Too many links
case ENFILE: // Too many open files in system case ENFILE: // Too many open files in system
case ENOBUFS: // No buffer space available case ENOBUFS: // No buffer space available
case ENODATA: // No message is available on the STREAM read queue
case ENOMEM: // Not enough space case ENOMEM: // Not enough space
case ENOSR: // No STREAM resources
#ifdef EUSERS #ifdef EUSERS
case EUSERS: // Too many users case EUSERS: // Too many users
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment