Back to index

glibc  2.9
warning-nop.c
Go to the documentation of this file.
00001 /* Dummy nop functions to elicit link-time warnings.
00002    Copyright (C) 2005 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #include <sys/cdefs.h>
00021 
00022 static void
00023 nop (void)
00024 {
00025 }
00026 
00027 /* Don't insert any other #include's before this #undef!  */
00028 
00029 #undef __warndecl
00030 #define __warndecl(name, msg) \
00031   extern void name (void) __attribute__ ((alias ("nop"))) attribute_hidden; \
00032   link_warning (name, msg)
00033 
00034 #undef __USE_FORTIFY_LEVEL
00035 #define __USE_FORTIFY_LEVEL 99
00036 
00037 /* Following here we need an #include for each public header file
00038    that uses __warndecl.  */
00039 
00040 /* Define away to avoid warnings with compilers that do not have these
00041    builtins.  */
00042 #define __builtin___memcpy_chk(dest, src, len, bos) NULL
00043 #define __builtin___memmove_chk(dest, src, len, bos) NULL
00044 #define __builtin___mempcpy_chk(dest, src, len, bos) NULL
00045 #define __builtin___memset_chk(dest, ch, len, bos) NULL
00046 #define __builtin___stpcpy_chk(dest, src, bos) NULL
00047 #define __builtin___strcat_chk(dest, src, bos) NULL
00048 #define __builtin___strcpy_chk(dest, src, bos) NULL
00049 #define __builtin___strncat_chk(dest, src, len, bos) NULL
00050 #define __builtin___strncpy_chk(dest, src, len, bos) NULL
00051 #define __builtin_object_size(bos, level) 0
00052 
00053 #include <string.h>