From 61062f56304750c367c5c1533351621353c112a7 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 1 Mar 2005 00:35:23 +0000 Subject: * posix/bits/unistd.h: Avoid calling __*_chk variants if we can determine the call will never trigger a failure. * sysdeps/i386/i686/memset_chk.S: Remove alias and warning. * sysdeps/x86_64/memset_chk.S: Likewise. 2005-02-24 Roland McGrath * debug/Versions (libc: GLIBC_2.4): Remove __memset_zero_constant_len_parameter. * sysdeps/generic/memset_chk.c: Remove alias and warning. * misc/sys/cdefs.h (__warndecl): New macro. * debug/warning-nop.c: New file. * string/bits/string3.h (memset): Call __warn_memset_zero_len with no arguments, instead of calling __memset_zero_constant_len_parameter. Use __warndecl for __warn_memset_zero_len. * debug/Makefile (routines): Add $(static-only-routines). (static-only-routines): New variable. --- string/bits/string3.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'string/bits') diff --git a/string/bits/string3.h b/string/bits/string3.h index 8fb66e41c8..6c027c23a0 100644 --- a/string/bits/string3.h +++ b/string/bits/string3.h @@ -85,11 +85,11 @@ __mempcpy_ichk (void *__restrict __dest, const void *__restrict __src, especially problematic if the intended fill value is zero. In this case no work is done at all. We detect these problems by referring non-existing functions. */ -extern char *__memset_zero_constant_len_parameter (void *, int, size_t, - size_t); +__warndecl (__warn_memset_zero_len, + "memset used with constant zero length parameter; this could be due to transposed parameters"); #define memset(dest, ch, len) \ (__builtin_constant_p (len) && (len) == 0 \ - ? __memset_zero_constant_len_parameter (dest, ch, len, 0) \ + ? (__warn_memset_zero_len (), (void) (ch), (void) (len), (void *) (dest)) \ : ((__bos0 (dest) != (size_t) -1) \ ? __builtin___memset_chk (dest, ch, len, __bos0 (dest)) \ : __memset_ichk (dest, ch, len))) -- cgit 1.4.1