tarantool / checkpatch

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

Fix a false positive MACRO_ARG_PRECEDENCE case #44

Closed nshy closed 1 year ago

nshy commented 1 year ago

Example which gives the FP:

  #define uptr_field_addr(obj, field) \
        ({ \
                (typeof(&((typeof(obj))0)->field)) \
                        ((char *)(obj) + (size_t)&((typeof(obj))0)->field); \
        })

  ERROR: Macro argument 'field' may be better as '(field)' to avoid
  precedence issues

And using () around field won't compile.

Closes #43