This! Casting the output of a function that returns (void*) is usually the first red flag of code not written by an experienced C programmer.
"We recommend that C developers use the C++ compiler to compile C code (using /TP if the file is named something.c). This is the best choice for using Visual C++ to compile C code."
From: https://herbsutter.com/2012/05/03/reader-qa-what-about-vc-an...
In addition to the MSVC issue mentioned in the sibling comment, I've worked on projects that used clang thread safety analysis, which at the time (and maybe still today) was only available for C++, so the build for that analysis was configured to build all C source files as C++.
int *buf = malloc(sizeof(*buf));
(It's noteworthy that while there's an implicit conversion above, there's no such thing as an implicit cast.)Of course it's not something everyone agrees to, but at least a lot of people seem to.
[1] https://stackoverflow.com/questions/605845/do-i-cast-the-res...