diff options
author | Vern Paxson <vern@ee.lbl.gov> | 1995-04-24 10:48:47 +0000 |
---|---|---|
committer | Vern Paxson <vern@ee.lbl.gov> | 1995-04-24 10:48:47 +0000 |
commit | d537ed41c3005f4cbb017ef8a78689c4f5d0bdb6 (patch) | |
tree | 89eb52cc76ca2e4f98244889ecee9db2e5ab5d9f | |
parent | 73464c0d63b71402d06be99a5c4f24f8daf1a24c (diff) |
(char*) cast for realloc
-rw-r--r-- | flex.skl | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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 |