git/banned.h

#ifndef BANNED_H
#define BANNED_H

/*
 * 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
 * errors.
 */

#define BANNED(func)

#undef strcpy
#define strcpy(x,y)
#undef strcat
#define strcat(x,y)
#undef strncpy
#define strncpy(x,y,n)
#undef strncat
#define strncat(x,y,n)
#undef strtok
#define strtok(x,y)
#undef strtok_r
#define strtok_r(x,y,z)

#undef sprintf
#undef vsprintf
#define sprintf(...)
#define vsprintf(...)

#undef gmtime
#define gmtime(t)
#undef localtime
#define localtime(t)
#undef ctime
#define ctime(t)
#undef ctime_r
#define ctime_r(t, buf)
#undef asctime
#define asctime(t)
#undef asctime_r
#define asctime_r(t, buf)

#endif /* BANNED_H */