[Solved] Error when coding my own implementation of realloc()

Invalid assumption: void *my_realloc(void *ptr, size_t size) { unsigned char *old_ptr = (unsigned char *)ptr; You’re breaking the realloc() specification here. realloc() doesn’t assume that the ptr would always be pointing to a string. It is type-agnostic. And the cast is redundant. There’s an implicit conversion from void * to any other pointer type. Undefined … Read more