Patch to detect invalid and missing ATTRIBUTE const/pure [take 2]
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Sun Mar 24 19:28:00 GMT 2002
> From: John Wehle <john@feith.com>
>
> >> 2. If a function is marked pure, and gcc detects the function is
> >> really const, should we proceed to apply the stricter attribute?
> >
> >I think so. It is same as marking unmarked function as pure :)
>
> I disagree. The programmer is explicitly stating a design decision
> by marking a function as pure. It's fair to suggestion in a "warning"
> message that the function could be marked const, however I'm not wild
> about the compiler overriding the programmer's decision on its own.
> -- John
I don't feel strongly about it so I'll go with your recommendation in
my next patch.
--
Kaveh R. Ghazi Director of Systems Architecture
ghazi@caip.rutgers.edu Qwest Global Services
More information about the Gcc-patches
mailing list