Issue |
132609
|
Summary |
add `-Wmacro-redefined-duplicate`
|
Labels |
new issue
|
Assignees |
|
Reporter |
kasperk81
|
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).
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs