unsuppressable error about invalid bitwise operation between different enumeration types #92340
Labels
clang:diagnostics
New/improved warning or error message in Clang, but not in clang-tidy or static analyzer
We use Infiniband API installed on hundreds of servers in our farm. It is in /usr/include/infiniband/verbs.h. For R&D, it is third-party software.
This program
#include <infiniband/verbs.h>
Then compilation fails like this
With -std=++2b, it does not.
The error is correct. What is incorrect is that the error has no ID and cannot be suppressed in any known way.
According to this page
https://clang.llvm.org/docs/DiagnosticsReference.html#wanon-enum-enum-conversion
I can make the second enum anon, too, by adding -Dibv_create_cq_wc_flags= to the command line. The error changes but stays an error:
This is a wrong general situation, every message must have an ID and be suppressable.
This is some info about the header:
-rw-r--r-- 1 root root 92862 Mar 22 2021 /usr/include/infiniband/verbs.h
a07809625d1024f1dfdf3db62a66ce88 /usr/include/infiniband/verbs.h
I am unsure if copying a couple of lines from that header to this ticket is a good idea.
The text was updated successfully, but these errors were encountered: