Skip to content

Instantly share code, notes, and snippets.

@0xabad1dea
Last active December 27, 2015 19:46
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xabad1dea/dc142f4134aeb0ba9f60 to your computer and use it in GitHub Desktop.
Save 0xabad1dea/dc142f4134aeb0ba9f60 to your computer and use it in GitHub Desktop.
banning macros
/* include this file AFTER your standard includes */
/* clang -Weverything -Wno-unused-macros */
/* SIGNED ARITHMETIC IS THE ENEMY. (use "signed" for main, etc.) */
#define int BANNED
/* THESE OTHER THINGS ARE ALSO THE ENEMY. */
#ifdef strcpy
#undef strcpy
#endif
#define strcpy BANNED
#ifdef strcat
#undef strcat
#endif
#define strcat BANNED
#ifdef strncat
#undef strncat
#endif
#define strncat BANNED
#ifdef strncpy
#undef strncpy
#endif
#define strncpy BANNED
#ifdef sprintf
#undef sprintf
#endif
#define sprintf BANNED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment