This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84905

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]