[Lldb-commits] [PATCH] D139740: [lldb] Disable macro redefinition warnings in expression wrapper

Michael Buch via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat Dec 10 09:00:42 PST 2022


Michael137 added inline comments.


================
Comment at: lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp:150
+  stream << "#pragma clang diagnostic push\n";
+  stream << "#pragma clang diagnostic ignored \"-Wmacro-redefined\"\n";
+  auto pop_warning = llvm::make_scope_exit([&stream](){
----------------
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:

```
(lldb) p alksjdh                                                                                          
error: expression failed to parse:                                                                        
warning: <lldb wrapper prefix>:252:9: redefining builtin macro                         
#define __FLT_EVAL_METHOD__ 0                                                                             
        ^                                                                                                 
error: <user expression 0>:1:1: use of undeclared identifier 'alksjdh'                                    
alksjdh                                                                                                   
^                                                                                                         
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139740/new/

https://reviews.llvm.org/D139740



More information about the lldb-commits mailing list