I'm okay with memmove if we think there can be overlap, I just wanted to ask 
since you didn't mention the reason for using it.  Other than that, I think it 
is better than the strcpy. 

-----Original Message-----
From: David Coakley [mailto:dcoak...@gmail.com] 
Sent: Thursday, September 23, 2010 3:52 PM
To: s...@cup.hp.com
Cc: Mike Murphy; open64-devel
Subject: Re: [Open64-devel] a memory copy bug in util/flags.c

Right, I was not certain that there would never be overlap.  I figured
that any performance difference was negligible for this part of the
compiler, so why not use memmove?

On Thu, Sep 23, 2010 at 3:44 PM, Steve Ellcey <s...@cup.hp.com> wrote:
> On Thu, 2010-09-23 at 15:26 -0700, Mike Murphy wrote:
>> I'm curious why you use memmove rather than memcpy?
>
> It looks like memcpy should be safe to use.  In most cases we are
> copying to or from a local variable and the pointer that is the other
> argument for memcpy can't be pointing at that variable.  The only one
> that isn't like that is Copy_option.  I don't think those arguments
> should overlap but I am not positive about it.
>
> Steve Ellcey
> s...@cup.hp.com
>
>
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to