Suppress misc-macro-parentheses warnings in system/libhidl.
Bug: 28705665
Test: make with WITH_TIDY=1 WITH_TIDY_CHECKS=-*,misc-macro-* \
WITH_TIDY_FLAGS=-header-filter=system/libhidl/.*
Change-Id: I52a5bc5ff35fdf50184543ac9033b194444e0806
diff --git a/base/include/hidl/HidlSupport.h b/base/include/hidl/HidlSupport.h
index 3f45afd..de5081d 100644
--- a/base/include/hidl/HidlSupport.h
+++ b/base/include/hidl/HidlSupport.h
@@ -172,15 +172,16 @@
void moveFrom(hidl_string &&);
};
+// Use NOLINT to suppress missing parentheses warnings around OP.
#define HIDL_STRING_OPERATOR(OP) \
inline bool operator OP(const hidl_string &hs1, const hidl_string &hs2) { \
- return strcmp(hs1.c_str(), hs2.c_str()) OP 0; \
+ return strcmp(hs1.c_str(), hs2.c_str()) OP 0; /* NOLINT */ \
} \
inline bool operator OP(const hidl_string &hs, const char *s) { \
- return strcmp(hs.c_str(), s) OP 0; \
+ return strcmp(hs.c_str(), s) OP 0; /* NOLINT */ \
} \
inline bool operator OP(const char *s, const hidl_string &hs) { \
- return strcmp(hs.c_str(), s) OP 0; \
+ return strcmp(hs.c_str(), s) OP 0; /* NOLINT */ \
}
HIDL_STRING_OPERATOR(==)