Merge branch 'jc/gpg-status'
[git/debian.git] / banned.h
blob28f5937035b762ad9fb091ea8fb7cc96f38fc92d
1 #ifndef BANNED_H
2 #define BANNED_H
4 /*
5 * This header lists functions that have been banned from our code base,
6 * because they're too easy to misuse (and even if used correctly,
7 * complicate audits). Including this header turns them into compile-time
8 * errors.
9 */
11 #define BANNED(func) sorry_##func##_is_a_banned_function
13 #undef strcpy
14 #define strcpy(x,y) BANNED(strcpy)
15 #undef strcat
16 #define strcat(x,y) BANNED(strcat)
17 #undef strncpy
18 #define strncpy(x,y,n) BANNED(strncpy)
20 #undef sprintf
21 #undef vsprintf
22 #ifdef HAVE_VARIADIC_MACROS
23 #define sprintf(...) BANNED(sprintf)
24 #define vsprintf(...) BANNED(vsprintf)
25 #else
26 #define sprintf(buf,fmt,arg) BANNED(sprintf)
27 #define vsprintf(buf,fmt,arg) BANNED(sprintf)
28 #endif
30 #endif /* BANNED_H */