Open
Description
C language allows macro redefinition as long as the values are the same. when values are different clang issues -Wmacro-redefined
.
a new diagnostic -Wmarco-redefined-duplicate
would help with code cleanup. clang already has that information (it clearly "skips" -Wmacro-redefined
when values are the same), so it should be able to expose it in pedantic mode.
there is an indirect way to detect it using -Wunused-macros
:
https://godbolt.org/z/dxG8K1cPb
but it only flags the first occurrence of same-value-duplicate as unused and doesn't show the other occurrence(s).