__mempcpy vs mempcpy

Svein E. Seldal Svein.Seldal@solidas.com
Fri Apr 11 13:56:00 GMT 2003


DJ Delorie wrote:
> For the libiberty/regex.c bug, please feel free to post a patch for
> __mempcpy -> mempcpy.  Consider it pre-approved.

gcc/fixinc/gnu-regex.c suffers from the same problem. Maybe a global 
search in the whole gcc source is in order?

I can fix it, but I'm going on easter holiday today. If it time critical 
to fix, maybe someone else should do it instead...

Dj Delorie: How did you intend to fix the bug? By changing this:

     #if defined HAVE_MEMPCPY || defined _LIBC
         *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
     #else
           memcpy (errbuf, msg, errbuf_size - 1);
           errbuf[errbuf_size - 1] = 0;
     #endif

into this?

     memcpy (errbuf, msg, errbuf_size - 1);
     errbuf[errbuf_size - 1] = 0;


Regards,
Svein



More information about the Gcc mailing list