On 2/15/19 6:57 PM, Sandra Loosemore wrote:
On 2/6/19 9:16 AM, Martin Sebor wrote:
The manual documents the -Wno-missing-attributes form of the option
as if it was enabled by default, even though it's enabled by -Wall
(I can't get this -Wno- convention straight in my head). I also
got private comments on the documentation of the option suggesting
to add cross-references, and to list the attributes
-Wattribute-alias considers (the same ones as -Wmissing-attributes).
The attached patch makes these changes.
I found the discussion of both options incomprehensible even with this
patch. :-( The defaults are incorrect, there are typos, awkward
wording and confusing paragraph organization, etc. So I consulted the
sources and came up with the attached alternative patch. Can you review
this for correctness and generally making sense?
Thanks. I think your update is fine. There's some overlap between
the -Wattribute-alias and -Wmissing-attributes warnings, as well
as some gaps in one or both, that could stand to be reviewed and
adjusted. I'm also don't think that diagnosing likely bugs only
at the optional level 2 and diagnosing potential optimization
oportunities at the default level 1 was the right decision. But
that will have to wait until GCC 10.
Martin
Index: gcc/common.opt
...
@@ -552,11 +552,11 @@ Warn about inappropriate attribute usage
Wattribute-alias
Common Alias(Wattribute_alias=, 1, 0) Warning
-Warn about type safety and similar errors and mismatches in attribute
alias and related.
+Warn about type safety and similar errors and mismatches in
declarations with alias attributes.
The "and related" part refers to other attributes that are similar to
but distinct from alias. I think the only such attribute is weakref.
It's probably not essential to make this one sentence 100% accurate
but I thought I'd mention it just for clarity.