c: fix crash when checking for compatibility of structures [PR116726]