On 8/25/21 5:00 PM, Jeff Law wrote:
On 8/25/2021 2:03 PM, Martin Sebor via Gcc-patches wrote:
Richard, some time ago you mentioned you'd had trouble getting
-Wuninitialized to print the note pointing to the uninitialized
variable. I said I'd look into it, and so I did. The attached
patch simplifies the warn_uninit() function to get rid of some
redundant cruft: besides a few pointless null tests and
a duplicate argument it also does away with ancient code that's
responsible for the problem you saw. It turns out that tests
for the problem are already in the test suite but have been
xfailed since the day they were added, so the patch simply
removes the xfails. I'll go ahead and commit this cleanup
as obvious later this week unless you have suggestions for
further changes.
Tested on x86_64-linux.
I'm going to object to installing this "as obvious". I don't see how
anyone could come to the conclusion this is obvious.
As I explained, the patch just a) removes unnecessary and/or
unused code, b) moves declarations closer to their point of
initialization, and c) gets rid of the linemap_location_before_p()
tests that prevent the note that Richard was looking for from being
printed. It has no effect besides that and it seems rather trivial
to me. But I don't want to reopen the whole "obviousness debate"
again.
Please wait for review.
Fine.
Martin