I started to look into glibc (GNU Libc)
to understand how it’s written. In malloc.c, I found a piece of code as follow:
#ifndef void
#define void void
#endif
Can someone please explain to me what this means? Isn’t void always defined?
Thanks
Looking at the git history, it was like this:
This was a workaround for historical [C], which did not have
voidandmalloc()returnedchar *instead ofvoid. The code was removed by Ulrich Drepper in 2011. The commit does not seems to be generated by a script or anything automatic, so he must had his intension to define like that.The commit message does not say anything about
void: