On 17. 1. 26 19:17, [email protected] wrote:
Author: rinrab
Date: Sat Jan 17 18:17:34 2026
New Revision: 1931392
Log:
Follow-up to r1931389: Fix compilation with MSVC.
* subversion/libsvn_subr/checksum_apr.c
(svn_checksum__sha1, svn_checksum__sha1_ctx_update): Cast 'void *' to
'char *' explicitly.
I don't understand. Implicit conversion from (const void*) to (const
char*) is allowed in C, it's only forbidden in C++, where you have to
use static_cast<const char*>. If MSVC treats this as an error, then it's
not a C compiler, which I doubt. So what was the error message from the
compiler that prompted this change?
The reason I'm commenting on this apparently trivial change is that
typecasts – any typecasts – in C are always suspect and should be
avoided if at all possible. Not because of some philosophical purity but
because they can silently hide new bug that might be introduced because
of some code change sometime in the future.
-- Brane