https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128607
Bug ID: 128607
Summary: DW_AT_producer records diagnostics-only options such
as -fdiagnostics-urls=
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
Assignee: unassigned at gcc dot gnu.org
Reporter: peter0x44 at disroot dot org
Target Milestone: ---
opts.cc has a list of options that aren't recorded into DW_AT_producer, because
they can't impact code generation or so.
https://forge.sourceware.org/gcc/gcc/src/commit/917da9c6e019407c9d469455ad4c50c062470d6c/gcc/opts.cc#L3916-L3977
However, this list is out of sync. I noticed this when I went to implement
-fdiagnostics-urls support in ccache.
https://github.com/ccache/ccache/pull/1852
Here is a list of missing ones that might not be exhaustive.
-fdiagnostics-*
-fdiagnostics-urls=
-fdiagnostics-add-output=
-fdiagnostics-set-output=
-fdiagnostics-column-origin=
-fdiagnostics-column-unit=
-fdiagnostics-escape-format=
-fdiagnostics-generate-patch
-fdiagnostics-json-formatting
-fdiagnostics-minimum-margin-width=
-fdiagnostics-parseable-fixits
-fdiagnostics-path-format=
-fdiagnostics-show-context=
-fdiagnostics-show-cwe
-fdiagnostics-show-path-depths
-fdiagnostics-show-rules
-fdiagnostics-text-art-charset=
Other names
-fmessage-length=
-fshow-column
-ftabstop=
-fmax-errors=
C++ only
-fdiagnostics-all-candidates
-fdiagnostics-show-template-tree
-felide-type
-fpretty-templates
-fconcepts-diagnostics-depth=
-ftemplate-backtrace-limit=
Having a hardcoded list that is difficult to keep in sync doesn't seem like a
great approach. Any suggestions on what to do about it?
Skipping -fdiagnostics-* might be a start.