memcpy(p,p,len)

2010-04-30 Thread Joakim Tjernlund
Is memcpy supposed to work when the src and dest are the same: memcpy(p, p, 100); Jocke

Re: memcpy(p,p,len)

2010-04-30 Thread Jan-Benedict Glaw
On Fri, 2010-04-30 16:08:15 +0200, Joakim Tjernlund joakim.tjernl...@transmode.se wrote: Is memcpy supposed to work when the src and dest are the same: memcpy(p, p, 100); It may work, but you cannot rely on it. Use memmove() alternatively. MfG, JBG -- Jan-Benedict Glaw

Re: memcpy(p,p,len)

2010-04-30 Thread Joakim Tjernlund
Jan-Benedict Glaw jbg...@lug-owl.de wrote on 2010/04/30 16:10:42: On Fri, 2010-04-30 16:08:15 +0200, Joakim Tjernlund joakim.tjernl...@transmode.se wrote: Is memcpy supposed to work when the src and dest are the same: memcpy(p, p, 100); It may work, but you cannot rely on it. Use

Re: memcpy(p,p,len)

2010-04-30 Thread Jan-Benedict Glaw
On Fri, 2010-04-30 16:14:36 +0200, Joakim Tjernlund joakim.tjernl...@transmode.se wrote: Jan-Benedict Glaw jbg...@lug-owl.de wrote on 2010/04/30 16:10:42: On Fri, 2010-04-30 16:08:15 +0200, Joakim Tjernlund joakim.tjernl...@transmode.se wrote: Is memcpy supposed to work when the src and

Re: memcpy(p,p,len)

2010-04-30 Thread Mark Mielke
Just a quick comment than Jan-Benedict's opinion is widely shared by the specification and by the Linux glibc manpage: DESCRIPTION The memcpy() function copies n bytes from memory area src to memory area dest. The memory areas should not overlap. Use memmove(3) if the

RE: memcpy(p,p,len)

2010-04-30 Thread Paul Koning
, April 30, 2010 10:15 AM To: Jan-Benedict Glaw Cc: gcc@gcc.gnu.org Subject: Re: memcpy(p,p,len) Jan-Benedict Glaw jbg...@lug-owl.de wrote on 2010/04/30 16:10:42: On Fri, 2010-04-30 16:08:15 +0200, Joakim Tjernlund joakim.tjernl...@transmode.se wrote: Is memcpy supposed to work when

Re: memcpy(p,p,len)

2010-04-30 Thread Joe Buck
On Fri, Apr 30, 2010 at 07:30:33AM -0700, Mark Mielke wrote: Just a quick comment than Jan-Benedict's opinion is widely shared by the specification and by the Linux glibc manpage: DESCRIPTION The memcpy() function copies n bytes from memory area src to memory area

Re: memcpy(p,p,len)

2010-04-30 Thread Richard Guenther
On Fri, Apr 30, 2010 at 5:05 PM, Joe Buck joe.b...@synopsys.com wrote: On Fri, Apr 30, 2010 at 07:30:33AM -0700, Mark Mielke wrote: Just a quick comment than Jan-Benedict's opinion is widely shared by the specification and by the Linux glibc manpage: DESCRIPTION         The  memcpy()  

Re: memcpy(p,p,len)

2010-04-30 Thread Joe Buck
On Fri, Apr 30, 2010 at 08:29:19AM -0700, Richard Guenther wrote: On Fri, Apr 30, 2010 at 5:05 PM, Joe Buck joe.b...@synopsys.com wrote: On Fri, Apr 30, 2010 at 07:30:33AM -0700, Mark Mielke wrote: Just a quick comment than Jan-Benedict's opinion is widely shared by the specification and by