tarantool / checkpatch

Checkpatch for Tarantool
GNU General Public License v2.0
2 stars 2 forks source link

False positive MACRO_ARG_PRECEDENCE #43

Closed nshy closed 1 year ago

nshy commented 1 year ago

And the trigger is:

ERROR: Macro argument 'field' may be better as '(field)' to avoid precedence issues
#141: FILE: src/trivia/util.h:158:
+#define uptr_field_addr(obj, field) \
+   ({ \
+       (typeof(&((typeof(obj))0)->field)) \
+           ((char *)(obj) + (size_t)&((typeof(obj))0)->field); \
+   })

Using brackets around field won't compile unfortunately.