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/81518] missing warning on a violation of attribute const requirements


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |---

--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
I disagree.  A warning would be helpful even in the absence of a definition and
evidence that the function actually access the pointed to data.  A warning
would also be helpful that pointed out that "it does not make sense for a const
function to return void" as the manual states.

Finally, even if the warning shouldn't be issued for declarations without the
evidence that the argument pointer isn't accessed, the warning could be
triggered once a definition were seen that did violate these requirements.

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