https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120960
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Martin Jambor <jamb...@gcc.gnu.org>: https://gcc.gnu.org/g:f555ee597ac4fa522da798e9c6a966903a5b7113 commit r16-2071-gf555ee597ac4fa522da798e9c6a966903a5b7113 Author: Martin Jambor <mjam...@suse.cz> Date: Mon Jul 7 21:50:19 2025 +0200 Ignore more clang warnings in contrib/filter-clang-warnings.py in contrib we have a script filter-clang-warnings.py which supposedly filters out uninteresting warnings emitted by clang when it compiles GCC. I'm not sure if anyone else uses it but our internal SUSE testing infrastructure does. Since Martin Liška left, I have mostly ignored the warnings and so they have multiplied. In an effort to improve the situation, I have tried to fix those warnings which I think are worth it and would like to adjust the filtering script so that we get to zero "interesting" warnings again. The changes are the following: 1. Ignore -Woverloaded-shift-op-parentheses warnings. IIUC, those make some sense when << and >> are used for I/O but since that is not the case in GCC they are not really interesting. 2. Ignore -Wunused-function and -Wunneeded-internal-declaration. I think it is OK to occasionally prepare APIs before they are used (and with our LTO we should be able to get rid of them). 3. Ignore -Wvla-cxx-extension and -Wunused-command-line-argument which just don't seem to be useful. 4. Ignore -Wunused-private-field warning in diagnostic-path-output.cc which can only be correct if quite a few functions are removed and looks like it is just not an oversight: gcc/diagnostic-path-output.cc:271:35: warning: private field 'm_logical_loc_mgr' is not used [-Wunused-private-field] 5. Ignore a case in -Wunused-but-set-variable about named_args which is used in a piece of code behind an ifdef in ipa-strub.cc. 6. Adjust the gimple-match and generic-match filters to the fact that we now have multiple such files. 7. Ignore warnings about using memcpy to copy around wide_ints, like the one below. I seem to remember wide-int has undergone fairly rigorous review and TBH I just hope I know what we are doing. gcc/wide-int.h:1198:11: warning: first argument in call to 'memcpy' is a pointer to non-trivially copyable type 'wide_int_storage' [-Wnontrivial-memcall] 8. Ignore -Wc++11-narrowing warning reported in omp-builtins.def when it is included from JIT. The code probably has a bigger issue described in PR 120960. 9. Since the patch number 14 in the original series did not get approved, I assume that private member field m_wanted_type of class element_expected_type_with_indirection in c-family/c-format.cc will get a use sooner or later, so I ignore a warning about it being unused. 10. I have decided to ignore warnings in m2/gm2-compiler-boot about unused stuff (all reported unused stuff are variables). These sources are in the build directory so I assume they are somehow generated and so warnings about unused things are a bit expected and probably not too bad. 11. On the Zulip chat, I have informed Rust folks they have a bunch of -Wunused-private-field cases in the FE. Until they sort it out I'm ignoring these. I might add the missing explicit type-cast case here too if it takes time for the patch I'm posting in this series to reach master. 12. I ignore warning about use of offsetof in libiberty/sha1.c which is apparently only a "C23 extension:" libiberty/sha1.c:239:11: warning: defining a type within 'offsetof' is a C23 extension [-Wc23-extensions] libiberty/sha1.c:460:11: warning: defining a type within 'offsetof' is a C23 extension [-Wc23-extensions] 13. I have enlarged the list of .texi files where warnings somehow got reported. Not sure why that happens. 14. In analyzer/sm.cc there are several "no-op" methods which have named but unused parameters. It seems this is deliberate and so I have filtered the -Wunused-parameter warning for this file. I have also re-arranged the entries in a way which hopefully makes somewhat more sense. Thanks, Martin contrib/ChangeLog: 2025-07-07 Martin Jambor <mjam...@suse.cz> * filter-clang-warnings.py (skip_warning): Also ignore -Woverloaded-shift-op-parentheses, -Wunused-function, -Wunneeded-internal-declaration, -Wvla-cxx-extension', and -Wunused-command-line-argument everywhere and a warning about m_logical_loc_mgr in diagnostic-path-output.cc. Adjust gimple-match and generic-match "filenames." Ignore -Wnontrivial-memcall warnings in wide-int.h, all warnings about unused stuff in files under m2/gm2-compiler-boot, all -Wunused-private-field in rust FE, in analyzer/ana-state-to-diagnostic-state.h and c-family/c-format.cc, all Warnings in avr-mmcu.texi, install.texi and libgccjit.texi and all -Wc23-extensions warnings in libiberty/sha1.c. Ignore -Wunused-parameter in analyzer/sm.cc. Reorder entries.