This is the mail archive of the gcc-help@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: C++: Difference between calling memcpy and __builtin_memcpy


The only reason not to do this is that the address of the strchr
function will not be consistent across the entire process.  Do you think
this could be a problem, even just a conformance problem?

I'm not sure I understand the concern.  There can be up to three
overloads of strchr in a program (one extern "C" and two extern
"C++" if the program includes C++ bits).  Each of the overloads
must has its own distinct address (and name) but that address of
the same overload needs to be the same across the whole program
(though the C bits will never see the C address and the C++ bits
have no way of accessing the C address in conforming programs).
As long as this invariant is maintained I don't think there is
a problem.

Martin


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