Skip to content
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

fix enum-compare-switch warning #1832

Closed
flier opened this issue Dec 2, 2022 · 0 comments · Fixed by #1833
Closed

fix enum-compare-switch warning #1832

flier opened this issue Dec 2, 2022 · 0 comments · Fixed by #1833
Labels
bug Something isn't working

Comments

@flier
Copy link
Contributor

flier commented Dec 2, 2022

Steps to reproduce
Build with clang-13 @ macosx

clang -v
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

What is the expected behavior?
no compile warning

What is the actual behavior?
a lot of enum-compare-switch warning

$ ninja
[1/2] Building CXX object exporters/otlp/CMakeFiles/opentelemetry_exporter_otlp_grpc_client.dir/src/otlp_grpc_utils.cc.o
/Users/flier/github/opentelemetry-cpp/exporters/otlp/src/otlp_grpc_utils.cc:53:10: warning: comparison of different enumeration types in switch statement ('::grpc::StatusCode' and 'grpc_status_code') [-Wenum-compare-switch]
    case GRPC_STATUS_DATA_LOSS:
         ^~~~~~~~~~~~~~~~~~~~~
/Users/flier/github/opentelemetry-cpp/exporters/otlp/src/otlp_grpc_utils.cc:51:10: warning: comparison of different enumeration types in switch statement ('::grpc::StatusCode' and 'grpc_status_code') [-Wenum-compare-switch]
    case GRPC_STATUS_UNAVAILABLE:
         ^~~~~~~~~~~~~~~~~~~~~~~
/Users/flier/github/opentelemetry-cpp/exporters/otlp/src/otlp_grpc_utils.cc:49:10: warning: comparison of different enumeration types in switch statement ('::grpc::StatusCode' and 'grpc_status_code') [-Wenum-compare-switch]
    case GRPC_STATUS_INTERNAL:
         ^~~~~~~~~~~~~~~~~~~~
/Users/flier/github/opentelemetry-cpp/exporters/otlp/src/otlp_grpc_utils.cc:47:10: warning: comparison of different enumeration types in switch statement ('::grpc::StatusCode' and 'grpc_status_code') [-Wenum-compare-switch]
    case GRPC_STATUS_UNIMPLEMENTED:
         ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/flier/github/opentelemetry-cpp/exporters/otlp/src/otlp_grpc_utils.cc:45:10: warning: comparison of different enumeration types in switch statement ('::grpc::StatusCode' and 'grpc_status_code') [-Wenum-compare-switch]
    case GRPC_STATUS_OUT_OF_RANGE:
         ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/flier/github/opentelemetry-cpp/exporters/otlp/src/otlp_grpc_utils.cc:43:10: warning: comparison of different enumeration types in switch statement ('::grpc::StatusCode' and 'grpc_status_code') [-Wenum-compare-switch]
    case GRPC_STATUS_ABORTED:
         ^~~~~~~~~~~~~~~~~~~
/Users/flier/github/opentelemetry-cpp/exporters/otlp/src/otlp_grpc_utils.cc:41:10: warning: comparison of different enumeration types in switch statement ('::grpc::StatusCode' and 'grpc_status_code') [-Wenum-compare-switch]
    case GRPC_STATUS_FAILED_PRECONDITION:
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/flier/github/opentelemetry-cpp/exporters/otlp/src/otlp_grpc_utils.cc:39:10: warning: comparison of different enumeration types in switch statement ('::grpc::StatusCode' and 'grpc_status_code') [-Wenum-compare-switch]
    case GRPC_STATUS_RESOURCE_EXHAUSTED:
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/flier/github/opentelemetry-cpp/exporters/otlp/src/otlp_grpc_utils.cc:37:10: warning: comparison of different enumeration types in switch statement ('::grpc::StatusCode' and 'grpc_status_code') [-Wenum-compare-switch]
    case GRPC_STATUS_UNAUTHENTICATED:
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/flier/github/opentelemetry-cpp/exporters/otlp/src/otlp_grpc_utils.cc:35:10: warning: comparison of different enumeration types in switch statement ('::grpc::StatusCode' and 'grpc_status_code') [-Wenum-compare-switch]
    case GRPC_STATUS_PERMISSION_DENIED:
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/flier/github/opentelemetry-cpp/exporters/otlp/src/otlp_grpc_utils.cc:33:10: warning: comparison of different enumeration types in switch statement ('::grpc::StatusCode' and 'grpc_status_code') [-Wenum-compare-switch]
    case GRPC_STATUS_ALREADY_EXISTS:
         ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/flier/github/opentelemetry-cpp/exporters/otlp/src/otlp_grpc_utils.cc:31:10: warning: comparison of different enumeration types in switch statement ('::grpc::StatusCode' and 'grpc_status_code') [-Wenum-compare-switch]
    case GRPC_STATUS_NOT_FOUND:
         ^~~~~~~~~~~~~~~~~~~~~
/Users/flier/github/opentelemetry-cpp/exporters/otlp/src/otlp_grpc_utils.cc:29:10: warning: comparison of different enumeration types in switch statement ('::grpc::StatusCode' and 'grpc_status_code') [-Wenum-compare-switch]
    case GRPC_STATUS_DEADLINE_EXCEEDED:
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/flier/github/opentelemetry-cpp/exporters/otlp/src/otlp_grpc_utils.cc:27:10: warning: comparison of different enumeration types in switch statement ('::grpc::StatusCode' and 'grpc_status_code') [-Wenum-compare-switch]
    case GRPC_STATUS_INVALID_ARGUMENT:
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/flier/github/opentelemetry-cpp/exporters/otlp/src/otlp_grpc_utils.cc:25:10: warning: comparison of different enumeration types in switch statement ('::grpc::StatusCode' and 'grpc_status_code') [-Wenum-compare-switch]
    case GRPC_STATUS_UNKNOWN:
         ^~~~~~~~~~~~~~~~~~~
/Users/flier/github/opentelemetry-cpp/exporters/otlp/src/otlp_grpc_utils.cc:23:10: warning: comparison of different enumeration types in switch statement ('::grpc::StatusCode' and 'grpc_status_code') [-Wenum-compare-switch]
    case GRPC_STATUS_CANCELLED:
         ^~~~~~~~~~~~~~~~~~~~~
/Users/flier/github/opentelemetry-cpp/exporters/otlp/src/otlp_grpc_utils.cc:21:10: warning: comparison of different enumeration types in switch statement ('::grpc::StatusCode' and 'grpc_status_code') [-Wenum-compare-switch]
    case GRPC_STATUS_OK:
         ^~~~~~~~~~~~~~
17 warnings generated.
[2/2] Linking CXX static library exporters/otlp/libopentelemetry_exporter_otlp_grpc_client.a
@flier flier added the bug Something isn't working label Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant