OpenEmbedded silenced the warning with a cast: https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-support/openldap/openldap/0001-fix-incompatible-pointer-type-error.patch?h=master
(also marked "Upstream-Status: Submitted", but I can't find any evidence of that online...)
bv_len was obtained from gnutls_hash_get_len just above, so we know it fits an unsigned int. But I don't know the rules of C here, is that pointer cast actually valid? I think a temporary variable like you suggested is a better idea. There is already a "size_t len" in scope used for similar purposes; I think we can probably use that.