THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Git Source Code Mirror - This is a publish-only repository and all pull requests are ignored. Please follow Documentation/SubmittingPatches procedure for any of your improvements.
git
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
796B

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