https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110543
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Benjamin Priour <vultk...@gcc.gnu.org>: https://gcc.gnu.org/g:ce8cdf5bcf96a2db6d7b9f656fc9ba58d7942a83 commit r14-3205-gce8cdf5bcf96a2db6d7b9f656fc9ba58d7942a83 Author: benjamin priour <vultk...@gcc.gnu.org> Date: Mon Aug 14 17:36:21 2023 +0200 analyzer: New option fanalyzer-show-events-in-system-headers [PR110543] This patch introduces -fanalyzer-show-events-in-system-headers, disabled by default. This option reduces the noise of the analyzer emitted diagnostics when dealing with system headers. The new option only affects the display of the diagnostics, but doesn't hinder the actual analysis. Given a diagnostics path diving into a system header in the form [ prefix events..., system header call, system header entry, events within system headers..., system header return, suffix events... ] then disabling the option (either by default or explicitly) will shorten the path into: [ prefix events..., system header call, system header return, suffix events... ] Signed-off-by: benjamin priour <priour...@gmail.com> gcc/analyzer/ChangeLog: PR analyzer/110543 * analyzer.opt: Add new option. * diagnostic-manager.cc (diagnostic_manager::prune_path): Call prune_system_headers. (prune_frame): New function that deletes all events in a frame. (diagnostic_manager::prune_system_headers): New function. * diagnostic-manager.h: Add prune_system_headers declaration. gcc/ChangeLog: PR analyzer/110543 * doc/invoke.texi: Add documentation of fanalyzer-show-events-in-system-headers gcc/testsuite/ChangeLog: PR analyzer/110543 * g++.dg/analyzer/fanalyzer-show-events-in-system-headers-default.C: New test. * g++.dg/analyzer/fanalyzer-show-events-in-system-headers-no.C: New test. * g++.dg/analyzer/fanalyzer-show-events-in-system-headers.C: New test.