[PATCH] Add gnu::diagnose_as attribute
Matthias Kretz
m.kretz@gsi.de
Fri Jun 11 10:01:51 GMT 2021
How can we make progress here? I could try to produce some "Tony Tables" of
diagnostic output of my modified stdx::simd. I believe it's a major
productivity boost to see abbreviated / "obfuscated" diagnostics *out-of-the
box* (with the possibility to opt-out). Actually, it already *is* a
productivity boost to me. Understanding diagnostics has improved from
"1. ooof, I'm not going to read this, let me rather guess what the issue was
2. sh** I have to read it
3. several minutes later: I finally found the five words to understand the
problem; I could use a break"
to
"1. right, let me check that"
For reference I'll attach my stdx::simd diagnose_as patch.
We could also talk about extending the feature to provide more information
about the diagnose_as substition. E.g. print a list of all diagnose_as
substitutions, which were used, at the end of the output stream. Or simpler,
print "note: some identifiers were simplified, use -fno-diagnostics-use-
aliases to see their real names".
On Tuesday, 1 June 2021 21:12:18 CEST Jason Merrill wrote:
> > Right, but then two of my design goals can't be met:
> >
> > 1. Diagnostics have an improved signal-to-noise ratio out of the box.
> >
> > 2. We can use replacement names that are not valid identifiers.
>
> This is the basic disconnect: I think that these goals are
> contradictory, and that replacement names that are not valid identifiers
> will just confuse users that don't know about them.
>
> If a user sees stdx::foo in a diagnostic and then tries to refer to
> stdx::foo and gets an error, the diagnostic is not more helpful than one
> that uses the fully qualified name.
>
> Jonathan, David, any thoughts on this issue?
--
──────────────────────────────────────────────────────────────────────────
Dr. Matthias Kretz https://mattkretz.github.io
GSI Helmholtz Centre for Heavy Ion Research https://gsi.de
std::experimental::simd https://github.com/VcDevel/std-simd
──────────────────────────────────────────────────────────────────────────
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-libstdc-Decrease-noise-in-diagnostics-via-diagnose_a.patch
Type: text/x-patch
Size: 3454 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20210611/23998a6e/attachment.bin>
More information about the Libstdc++
mailing list