// Copyright Johannes Kapfhammer 2019-2022. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef SOI_HEADER_DEPRECATE #define SOI_HEADER_DEPRECATE #pragma GCC diagnostic error "-Wdeprecated-declarations" struct endl_is_evil_t { } endl_is_evil; [[deprecated("endl is evil. Use '\\n' to print a newline.")]] std::ostream & operator<<(std::ostream &os, endl_is_evil_t); #define endl endl_is_evil #define printf printf_is_evil #define fprintf fprintf_is_evil #define sprintf sprintf_is_evil #define snprintf snprintf_is_evil [[deprecated("printf is evil. Use cout.")]] int printf(const char *format, ...); [[deprecated("printf is evil. Use cout.")]] int fprintf(std::FILE *stream, const char *format, ...); [[deprecated("printf is evil. Use cout.")]] int sprintf(char *buffer, const char *format, ...); [[deprecated("printf is evil. Use cout.")]] int snprintf(char *buffer, std::size_t buf_size, const char *format, ...); #define scanf scanf_is_evil #define fscanf fscanf_is_evil #define sscanf sscanf_is_evil [[deprecated("scanf is evil. Use cin.")]] int scanf(const char *format, ...); [[deprecated("scanf is evil. Use cin.")]] int fscanf(std::FILE *stream, const char *format, ...); [[deprecated("scanf is evil. Use cin.")]] int sscanf(const char *buffer, const char *format, ...); #define puts puts_is_evil #define fputs fputs_is_evil #define fgets fgets_is_evil #define fopen fopen_is_evil #define fclose fclose_is_evil #define fflush fflush_is_evil #define getchar getchar_is_evil #define fgetc fgetc_is_evil #define getc getc_is_evil #define setbuf setbuf_is_evil #define setvbuf setvbuf_is_evil #define fread fread_is_evil #define fwrite fwrite_is_evil [[deprecated(" is evil. Use cin/cout.")]] int puts(const char *str); [[deprecated(" is evil. Use cin/cout.")]] int fputs(const char *str, FILE *stream); [[deprecated(" is evil. Use cin/cout.")]] char * fgets(char *str, int count, FILE *stream); [[deprecated(" is evil. Use cin/cout.")]] std::FILE * fopen(const char *filename, const char *mode); [[deprecated(" is evil. Use cin/cout.")]] int fclose(std::FILE *stream); [[deprecated(" is evil. Use cin/cout.")]] int fflush(std::FILE *stream); [[deprecated(" is evil. Use cin/cout.")]] int getchar(); [[deprecated(" is evil. Use cin/cout.")]] int fgetc(std::FILE *stream); [[deprecated(" is evil. Use cin/cout.")]] int getc(std::FILE *stream); [[deprecated(" is evil. Use cin/cout.")]] void setbuf(std::FILE *stream, char *buffer); [[deprecated(" is evil. Use cin/cout.")]] int setvbuf(std::FILE *stream, char *buffer, int mode, std::size_t size); [[deprecated(" is evil. Use cin/cout.")]] std::size_t fread(void *buffer, std::size_t size, std::size_t count, std::FILE *stream); [[deprecated(" is evil. Use cin/cout.")]] std::size_t fwrite(const void *buffer, std::size_t size, std::size_t count, std::FILE *stream); #define malloc malloc_is_evil #define calloc calloc_is_evil #define realloc realloc_is_evil #define free free_is_evil [[deprecated("malloc/free is evil. Use a vector.")]] void * malloc(std::size_t size); [[deprecated("malloc/free is evil. Use a vector.")]] void * calloc(std::size_t num, std::size_t size); [[deprecated("malloc/free is evil. Use a vector.")]] void * realloc(void *ptr, std::size_t new_size); [[deprecated("malloc/free is evil. Use a vector.")]] void * free(void *ptr, std::size_t new_size); //[[deprecated("new is evil. Use a vector.")]] void * //operator new(std::size_t sz); //[[deprecated("delete is evil. Use a vector.")]] void //operator delete(void *ptr) noexcept; #endif // SOI_HEADER_DEPRECATE