[Bug c++/84905] Improve warning for __attribute__((const)) on function returning void

2018-03-26 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84905

--- Comment #5 from Eric Gallager  ---
(In reply to Martin Sebor from comment #4)
> Resolving as Won't Fix based on comment #2.  (I will update
> gcc-8/changes.html before the release and may update the documentation of
> attribute const in the manual with additional detail.)

Maybe also add a note to https://gcc.gnu.org/wiki/VerboseDiagnostics

[Bug c++/84905] Improve warning for __attribute__((const)) on function returning void

2018-03-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84905

Martin Sebor  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #4 from Martin Sebor  ---
Resolving as Won't Fix based on comment #2.  (I will update gcc-8/changes.html
before the release and may update the documentation of attribute const in the
manual with additional detail.)

[Bug c++/84905] Improve warning for __attribute__((const)) on function returning void

2018-03-19 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84905

--- Comment #3 from Jonathan Wakely  ---
No suggestions here, I was just passing on it on. My response on IRC was pretty
much what you said: you need to read the manual to know what the attribute
does, the warning is not the place to put that info.

[Bug c++/84905] Improve warning for __attribute__((const)) on function returning void

2018-03-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84905

Martin Sebor  changed:

   What|Removed |Added

 Status|NEW |WAITING

--- Comment #2 from Martin Sebor  ---
Agreed that the new attributes warnings should be mentioned in
gcc-8/changes.html (I still need to submit my updates).

This particular warning is issued based on the note in the manual: "It does not
make sense for a const function to return void" (it might be worthwhile to
expand on why it doesn't make sense in case it's not clear from the prior
text).  I tend to prefer descriptive warnings over other kinds and I'm not sure
that changing it to say "attribute const doesn't make sense for a void
function" would be an improvement.  Either way, as in many other cases, to
understand this warning the user needs to know why the attribute doesn't make
sense and that cannot easily be summed up in a single sentence.  The only way
to find that out is to read up on what the attribute is used for by GCC.

Jon, unless you have a suggestion for a different phrasing that makes it
clearer I'm inclined to resolve this part of the report as won't fix.

[Bug c++/84905] Improve warning for __attribute__((const)) on function returning void

2018-03-16 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84905

Eric Gallager  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-16
 CC||egallager at gcc dot gnu.org,
   ||msebor at gcc dot gnu.org
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=83559
 Ever confirmed|0   |1

--- Comment #1 from Eric Gallager  ---
Confirmed. Related: bug 83559