summaryrefslogtreecommitdiff
path: root/src/poison.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/poison.hpp')
-rw-r--r--src/poison.hpp57
1 files changed, 55 insertions, 2 deletions
diff --git a/src/poison.hpp b/src/poison.hpp
index d196bc6..46e6d65 100644
--- a/src/poison.hpp
+++ b/src/poison.hpp
@@ -5,7 +5,6 @@
// TODO fill in as they are removed from source code:
// double (use a fixed class)
#pragma GCC poison float
-// mem* and str* from <string.h>, in favor of <algorithm>
// Local time is forbidden.
#pragma GCC poison timelocal // timegm
@@ -15,11 +14,65 @@
#pragma GCC poison time // TimeT::now() or gettick()
+// Avoid manual allocations.
// Use some sort of managed container, or at least dumb_ptr
-#if 0
+
+// new is needed when resetting unique_ptr.
+// No it isn't. It doesn't matter if it's a little more verbose; it's cleaner.
+//#define really_new1 new
+// delete is needed for unique_ptr's deleter.
+#define really_delete1 delete
+
+#pragma GCC poison new
+#pragma GCC poison delete
+
#pragma GCC poison malloc
#pragma GCC poison calloc
#pragma GCC poison realloc
#pragma GCC poison free
+
#pragma GCC poison strdup
+#pragma GCC poison strndup
+
+// complete list of glibc whose results may need to be free()d
+// not believed to be used
+#pragma GCC poison posix_memalign
+#pragma GCC poison aligned_alloc
+#pragma GCC poison memalign
+#pragma GCC poison valloc
+#pragma GCC poison pvalloc
+
+#pragma GCC poison asprintf
+#pragma GCC poison vasprintf
+
+#pragma GCC poison canonicalize_file_name
+
+#pragma GCC poison cfree
+
+#pragma GCC poison open_memstream
+#pragma GCC poison open_wmemstream
+
+// *scanf %ms is done very carefully.
+//#pragma GCC poison scanf
+//#pragma GCC poison fscanf
+//#pragma GCC poison sscanf
+//#pragma GCC poison vscanf
+//#pragma GCC poison vsscanf
+//#pragma GCC poison vfscanf
+
+#pragma GCC poison getcwd
+#pragma GCC poison get_current_dir_name
+
+#pragma GCC poison malloc_get_state
+
+#pragma GCC poison realpath
+
+#pragma GCC poison tempnam
+
+#pragma GCC poison wcsdup
+
+#if 0
+#pragma GCC poison memcpy
+#pragma GCC poison memmove
+#pragma GCC poison memset
#endif