Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/banned.h # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / banned.h` 47 lines ยท 1131 bytes Raw Blame History 1 #ifndef BANNED_H 2 #define BANNED_H 3 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 */ 10 11 #define BANNED(func) sorry_##func##_is_a_banned_function 12 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) 19 #undef strncat 20 #define strncat(x,y,n) BANNED(strncat) 21 #undef strtok 22 #define strtok(x,y) BANNED(strtok) 23 #undef strtok_r 24 #define strtok_r(x,y,z) BANNED(strtok_r) 25 26 #undef sprintf 27 #undef vsprintf 28 #define sprintf(...) BANNED(sprintf) 29 #define vsprintf(...) BANNED(vsprintf) 30 31 #undef gmtime 32 #define gmtime(t) BANNED(gmtime) 33 #undef localtime 34 #define localtime(t) BANNED(localtime) 35 #undef ctime 36 #define ctime(t) BANNED(ctime) 37 #undef ctime_r 38 #define ctime_r(t, buf) BANNED(ctime_r) 39 #undef asctime 40 #define asctime(t) BANNED(asctime) 41 #undef asctime_r 42 #define asctime_r(t, buf) BANNED(asctime_r) 43 44 #undef mktemp 45 #define mktemp(x) BANNED(mktemp) 46 47 #endif /* BANNED_H */