# Apply -O so as to run in reasonable time.
origin5_bz2_CFLAGS = $(AM_CFLAGS) -O -Wno-inline
+if VGCONF_OS_IS_DARWIN
+origin5_bz2_CFLAGS += -fno-inline
+endif
origin6_fp_CFLAGS = $(AM_CFLAGS) -O
+if VGCONF_OS_IS_DARWIN
+origin6_fp_CFLAGS += -fno-inline
+endif
# Don't allow GCC to inline memcpy() and strcpy(),
# because then we can't intercept it
# To make it a bit more realistic, have some optimisation enabled
# for the varinfo tests. We still expect sane results.
varinfo1_CFLAGS = $(AM_CFLAGS) -O @FLAG_W_NO_MAYBE_UNINITIALIZED@
+if VGCONF_OS_IS_DARWIN
+varinfo1_CFLAGS += -fno-inline
+endif
varinfo2_CFLAGS = $(AM_CFLAGS) -O -Wno-shadow @FLAG_W_NO_MAYBE_UNINITIALIZED@
+if VGCONF_OS_IS_DARWIN
+varinfo2_CFLAGS += -fno-inline
+endif
varinfo3_CFLAGS = $(AM_CFLAGS) -O @FLAG_W_NO_MAYBE_UNINITIALIZED@
+if VGCONF_OS_IS_DARWIN
+varinfo3_CFLAGS += -fno-inline
+endif
varinfo4_CFLAGS = $(AM_CFLAGS) -O @FLAG_W_NO_MAYBE_UNINITIALIZED@
+if VGCONF_OS_IS_DARWIN
+varinfo4_CFLAGS += -fno-inline
+endif
varinfo5_CFLAGS = $(AM_CFLAGS) -O
varinfo6_CFLAGS = $(AM_CFLAGS) -O @FLAG_W_NO_MAYBE_UNINITIALIZED@
+if VGCONF_OS_IS_DARWIN
+varinfo6_CFLAGS += -fno-inline
+endif
+
# Build shared object for varinfo5
varinfo5_SOURCES = varinfo5.c
./filter_stderr "$@" |
-sed 's/ _platform_memcmp / memcmp /;s/ bcmp / memcmp /;s/ _platform_memccpy / memccpy /'
+sed 's/ _platform_memcmp / memcmp /;s/ bcmp / memcmp /;s/ _platform_memccpy / memccpy /;s/ __memccpy_chk / memccpy /;s/ __strncat_chk / strncat /;s/ __strncpy_chk / strncpy /;s/ __strcpy_chk / strcpy /'
{
char* astring = strdup("this is a string # with something to seek");
size_t len = strlen(astring);
- (memccpy)(astring+10, astring, '#', len-10);
+ memccpy(astring+10, astring, '#', len-10);
sprintf(astring, "this is a string # with something to seek");
- (memccpy)(astring, astring+10, '#', len);
+ memccpy(astring, astring+10, '#', len);
sprintf(astring, "this is a string # with something to seek");
/*
assert(res && *res == 'g');
sprintf(astring, "this is a string # with something to seek");
/* length is 0, nothing copied, returns NULL */
- res = (memccpy)(astring, "abcdefhhijklmnopqrstuvwxy", 'z', 0);
+ res = memccpy(astring, "abcdefhhijklmnopqrstuvwxy", 'z', 0);
assert(NULL == res);
/* 'z' not found so 20 bytes copied, returns NULL */
- res = (memccpy)(astring, "abcdefhhijklmnopqrstuvwxy", 'z', 20);
+ res = memccpy(astring, "abcdefhhijklmnopqrstuvwxy", 'z', 20);
assert(NULL == res);
free(astring);
}
memcpy(x, x+20, 21); // overlap
strncpy(x+20, x, 20); // ok
- (strncpy)(x+20, x, 21); // overlap
+ strncpy(x+20, x, 21); // overlap
strncpy(x, x+20, 20); // ok
- (strncpy)(x, x+20, 21); // overlap
+ strncpy(x, x+20, 21); // overlap
x[39] = '\0';
strcpy(x, x+20); // ok
x[39] = 39;
x[40] = '\0';
- (strcpy)(x, x+20); // overlap
+ strcpy(x, x+20); // overlap
x[19] = '\0';
strcpy(x+20, x); // ok
always run forever, I think... */
for ( i = 0; i < 2; i++)
- (strncat)(a+20, a, 21); // run twice to check 2nd error isn't shown
- (strncat)(a, a+20, 21);
+ strncat(a+20, a, 21); // run twice to check 2nd error isn't shown
+ strncat(a, a+20, 21);
/* This is ok, but once gave a warning when strncpy() was wrong,
and used 'n' for the length, even when the src was shorter than 'n' */
vgopts: -q
# https://bugs.kde.org/show_bug.cgi?id=402833
prereq: ! ../../tests/os_test linux || ! ../../tests/arch_test amd64
+stderr_filter: filter_libc_variants
STRNCAT(VG_Z_LIBC_SONAME, strncat)
#elif defined(VGO_darwin)
- //STRNCAT(VG_Z_LIBC_SONAME, strncat)
+ STRNCAT(VG_Z_LIBSYSTEM_C_SONAME, strncat)
+ STRNCAT(VG_Z_LIBSYSTEM_C_SONAME, __strncat_chk)
//STRNCAT(VG_Z_DYLD, strncat)
#elif defined(VGO_solaris)
#elif defined(VGO_darwin)
STRCPY(VG_Z_LIBC_SONAME, strcpy)
-# if DARWIN_VERS == DARWIN_10_9
- STRCPY(VG_Z_LIBSYSTEM_C_SONAME, strcpy)
-# endif
+ STRCPY(VG_Z_LIBSYSTEM_C_SONAME, strcpy)
+ STRCPY(VG_Z_LIBSYSTEM_C_SONAME, __strcpy_chk)
#elif defined(VGO_solaris)
STRCPY(VG_Z_LIBC_SONAME, strcpy)
#elif defined(VGO_darwin)
STRNCPY(VG_Z_LIBC_SONAME, strncpy)
-# if DARWIN_VERS >= DARWIN_10_9
- STRNCPY(VG_Z_LIBSYSTEM_C_SONAME, strncpy)
-# endif
+ STRNCPY(VG_Z_LIBSYSTEM_C_SONAME, strncpy)
+ STRNCPY(VG_Z_LIBSYSTEM_C_SONAME, __strncpy_chk)
#elif defined(VGO_solaris)
STRNCPY(VG_Z_LIBC_SONAME, strncpy)
# endif
MEMCPY(VG_Z_LIBC_SONAME, memcpyZDVARIANTZDsse3x) /* memcpy$VARIANT$sse3x */
MEMCPY(VG_Z_LIBC_SONAME, memcpyZDVARIANTZDsse42) /* memcpy$VARIANT$sse42 */
+ MEMCPY(VG_Z_LIBSYSTEM_C_SONAME, __memcpy_chk)
#elif defined(VGO_solaris)
MEMCPY(VG_Z_LIBC_SONAME, memcpy)
#if defined(VGO_linux) || defined(VGO_freebsd) || defined(VGO_solaris)
MEMCCPY(VG_Z_LIBC_SONAME, memccpy)
#elif defined(VGO_darwin)
+ MEMCCPY(VG_Z_LIBSYSTEM_C_SONAME, __memccpy_chk)
MEMCCPY(VG_Z_LIBSYSTEM_PLATFORM_SONAME, _platform_memccpy)
#endif