GCC emits macro definitions into debug info when compiling with -g3.
LLDB is translating this information into #define directives which are injected into the
source code of user expressions. While this mechanism itself works fine, it can lead to
spurious "... macro redefined" warnings when the defined macro is also a builtin Clang macro:
warning: <lldb wrapper prefix>:46:9: '__VERSION__' macro redefined #define __VERSION__ "12.1.0" ^ <built-in>:19:9: previous definition is here #define __VERSION__ "Clang 14.0.6" [repeated about a 100 more times for every builtin macro]
This patch just disables the diagnostic when parsing LLDB's generated list of
macros definitions.
You might want to also add -Wbuiltin-macro-redefined
Just tried this change on my Ubuntu VM with gcc-11 and it gets rid of most diagnostics apart from one: