# Minor fix for pedantic compiler

- Thread: https://externals.io/message/12912
- Original archive: https://news-web.php.net/php.internals/12912
- Started by l0t3k on 2004-09-20T05:31:20+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #12912 — l0t3k — 2004-09-20T05:31:20+00:00

URL: https://externals.io/message/12912#12912

i'm compiling a C++ extension and the smart_str macros are causing MSVC to
spill warnings about converting void* to char *.
Casting the return from the SMART_STR_REALLOC macro seems to fix it.


#ifdef SMART_STR_USE_REALLOC
-#define SMART_STR_REALLOC(a,b,c) realloc((a),(b))
+#define SMART_STR_REALLOC(a,b,c) (char *)realloc((a),(b))
#else
-#define SMART_STR_REALLOC(a,b,c) perealloc((a),(b),(c))
+#define SMART_STR_REALLOC(a,b,c) (char *)perealloc((a),(b))
#endif
