From c324624291a8c7cfbfcc728ce9fa86feb8d4e904 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Wed, 17 Nov 2010 07:41:29 -0200 Subject: [PATCH] Bug#57994: Compiler flag change build error : my_redel.c Use __builtin_stpcpy only if the system supports stpcpy. This is necessary as in some cases a call to stpcpy will be emitted if the built-in can not optimized. include/m_string.h: The expansion of stpcpy (in glibc) causes warnings if the return value of strmov is not being used. Since stpcpy is a GNU extension and the expansion ends up using a built-in provided by GCC, use the compiler provided built-in directly when possible. Nonetheless, the C library must have stpcpy as a call be emitted if the built-in can not optimized. --- include/m_string.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/m_string.h b/include/m_string.h index 933da84c336..c963e605501 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -73,8 +73,8 @@ extern "C" { extern void *(*my_str_malloc)(size_t); extern void (*my_str_free)(void *); -#if MY_GNUC_PREREQ(3, 4) -#define strmov(dest, src) __builtin_stpcpy(dest, src) +#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) +#define strmov(A,B) __builtin_stpcpy((A),(B)) #elif defined(HAVE_STPCPY) #define strmov(A,B) stpcpy((A),(B)) #ifndef stpcpy