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 tree-optimization/18487] Warnings for pure and const functions that are not actually pure or const



------- Comment #5 from gnu at behdad dot org  2007-08-13 05:40 -------
(In reply to comment #2)

> If the compiler could tell whether you were right or not in all cases, you
> wouldn't need the attributes in the first place.

This is not completely true though: the compiler cannot tell by just seeing the
prototype.  So, even if the compiler could recognize all pure and const
functions when compiling them, that doesn't help when you need to mark the
prototypes of those functions as pure/const to help the compiler compiling
other programs using them.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18487


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