fork download
  1. #define BANNED(func) sorry_##func##_is_a_banned_function
  2.  
  3. #undef strcpy
  4. #define strcpy(x,y) BANNED(strcpy)
  5.  
  6. int main() {
  7. strcpy(NULL, NULL);
  8.  
  9. return 0;
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:1:22: error: ‘sorry_strcpy_is_a_banned_function’ was not declared in this scope
 #define BANNED(func) sorry_##func##_is_a_banned_function
                      ^~~~~~
prog.cpp:4:21: note: in expansion of macro ‘BANNED’
 #define strcpy(x,y) BANNED(strcpy)
                     ^~~~~~
prog.cpp:7:2: note: in expansion of macro ‘strcpy’
  strcpy(NULL, NULL);
  ^~~~~~
stdout
Standard output is empty