This is the mail archive of the gcc-patches@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]

Re: [RFC]: patch to detect invalid and missing ATTRIBUTE const/pure


 > From: John Wehle <john@feith.com>
 > 
 > With your change mark_constant_function will attempt to mark
 > non-static functions which can cause problems due to potentially
 > differing implementations of a routine present in a shared library.
 > -- John

I don't quite understand how that arises.  Here's my understanding:

Supposing mark_constant_function is examining an extern function foo,
let's say it decides to mark foo as pure.  That marking only takes
effect for the rest of that module since the extern prototype of foo()
seen by other files still doesn't have the attribute automatically
added to it.

Now any calls to foo() inside the original module would resovle to the
definition inside the file, regardless of whether we eventually link
with a shared lib having another copy of foo, right?  In that case,
we can't have the "differing implementations" problem AFAICT.

Can you help me understand where this reasoning is flawed?  (Or if its
already been discussed, just point me at the URL.)

		Thanks,
		--Kaveh
--
Kaveh R. Ghazi			Director of Systems Architecture
ghazi@caip.rutgers.edu		Qwest Global Services


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