This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: amazing memcpy bug on Solaris
- To: help-gcc at gnu dot org
- Subject: Re: amazing memcpy bug on Solaris
- From: bijwaard at speed dot DoNotSpamA2000 dot nl
- Date: 29 Aug 1999 12:40:40 GMT
- Newsgroups: gnu.gcc.help
- Organization: A2000 Kabeltelevisie en Telecommunicatie
- References: <37c91c99.21319035@news.barak.net.il>
- Xref: wodc7nx0 gnu.gcc.help:742
mhalibard@csafe.com wrote:
> I have encountered a truly amazing bug when compiling with gcc on
> solaris. I would be grateful to anybody who can explain what on earth
> is going wrong.
In linux man memcpy:
void *memcpy(void *dest, const void *src, size_t n);
DESCRIPTION
The memcpy() function copies n bytes from memory area src
to memory area dest. The memory areas may not overlap.
Use memmove(3) if the memory areas do overlap.
On solaris 2.6 man memcpy:
void *memcpy(void *s1, const void *s2, size_t n);
memcpy() copies n bytes from memory area s2 to s1. It
returns s1.
You seem to copy from the outBuff into the buffer_ptr, which is
const in the first example.
Try to swap the buffer_ptr and outBuff arguments.
--
Kind regards,
Dennis Bijwaard (remove antispam to reply)
http://people.a2000.nl/dbijwaar