INTERESTING TO FORMER C PROGRAMMERS. LIST OF BANNED C FUNCTIONS AT MICROSOFT/GIT...
* This header lists functions that have been banned from our code base, |
* because they're too easy to misuse (and even if used correctly, |
* complicate audits). Including this header turns them into compile-time |
#define BANNED(func) sorry_##func##_is_a_banned_function |
#define strcpy(x,y) BANNED(strcpy) |
#define strcat(x,y) BANNED(strcat) |
#define strncpy(x,y,n) BANNED(strncpy) |
#define strncat(x,y,n) BANNED(strncat) |
#ifdef HAVE_VARIADIC_MACROS |
#define sprintf(...) BANNED(sprintf) |
#define vsprintf(...) BANNED(vsprintf) |
#define sprintf(buf,fmt,arg) BANNED(sprintf) |
#define vsprintf(buf,fmt,arg) BANNED(vsprintf) |
#define gmtime(t) BANNED(gmtime) |
#define localtime(t) BANNED(localtime) |
#define ctime(t) BANNED(ctime) |
#define ctime_r(t, buf) BANNED(ctime_r) |
#define asctime(t) BANNED(asctime) |
#define asctime_r(t, buf) BANNED(asctime_r) | #endif /* BANNED_H */ |