summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVern Paxson <vern@ee.lbl.gov>1995-04-24 10:48:47 +0000
committerVern Paxson <vern@ee.lbl.gov>1995-04-24 10:48:47 +0000
commitd537ed41c3005f4cbb017ef8a78689c4f5d0bdb6 (patch)
tree89eb52cc76ca2e4f98244889ecee9db2e5ab5d9f
parent73464c0d63b71402d06be99a5c4f24f8daf1a24c (diff)
(char*) cast for realloc
-rw-r--r--flex.skl9
1 files changed, 8 insertions, 1 deletions
diff --git a/flex.skl b/flex.skl
index 431b408..218e652 100644
--- a/flex.skl
+++ b/flex.skl
@@ -1480,7 +1480,14 @@ void *ptr;
yy_size_t size;
#endif
{
- return (void *) realloc( ptr, size );
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
}
#ifdef YY_USE_PROTOS