diff --git a/dist/tools/compile_commands/compile_commands.py b/dist/tools/compile_commands/compile_commands.py index 61461e8aba..bc46006ff4 100755 --- a/dist/tools/compile_commands/compile_commands.py +++ b/dist/tools/compile_commands/compile_commands.py @@ -228,6 +228,9 @@ def generate_module_compile_commands(path, state, args): except ValueError: pass + if args.clangd: + cdetails.cflags.append('-Wno-unknown-warning-option') + c_extra_includes = [] cxx_extra_includes = [] @@ -288,12 +291,13 @@ if __name__ == '__main__': help='Drop the given flag, if present (repeatable)') parser.add_argument('--clangd', default=False, action='store_const', const=True, help='Shorthand for --add-built-in-includes --add-libstdxx-includes ' + - 'and some CFLAG adjustments throughy --filter-out') + 'and some CFLAG adjustments throughy --filter-out, and ignores ' + + 'unknown warning flags') _args = parser.parse_args() if _args.clangd: _args.add_built_in_includes = True _args.add_libstdcxx_includes = True - _args.filter_out = ['-Wformat-truncation', '-Wformat-overflow', '-mno-thumb-interwork', + _args.filter_out = ['-mno-thumb-interwork', # Only even included for versions of GCC that support it '-malign-data=natural', # Only supported starting with clang 11