Hi, Here's another update to the ensure_size_t patch. The following changes have been made to the patch: * The function is now called ulongest_fits_host_or_error and is now in utils.c. I have named it so to give room for a future 'longest_fits_host_orr_error' if needed. They have to be different because the error message will have to be printed differently (plongest vs pulongest). The name also looks neater in general. * I have reverted the size_t checks from most tdep files in favour of promoting the value_contents call ahead. In fact, barring h8300h_return_value, all of them have an earlier value_contents call, making the check unnecessary. This change applies on top of the bitpos patch and I have verified that the change does not cause any regressions. Regards, Siddhesh gdb/ChangeLog * alpha-tdep.c (alpha_push_dummy_call) Check for underflow in SP. * cp-valprint (cp_print_value): Ensure BASECLASS fits into size_t. * dwarf2loc.c (read_pieced_value): Ensure that THIS_SIZE fits into size_t. (write_pieced_value): Likewise. * h8300-tdep.c (h8300h_return_value): Ensure that TYPE fits into size_t. * p-valprint (pascal_object_print_value): Ensure BASECLASS fits into size_t. * utils.c (ulongest_fits_host_or_error): New function to find if a ULONGEST number fits into size_t. * utils.h: Declare ulongest_fits_host_or_error. * valops.c (search_struct_method): Ensure BASECLASS fits into size_t. * value.c (allocate_value_lazy): Ensure TYPE fits into size_t. (allocate_value_contents): Likewise. (set_value_enclosing_type): Ensure NEW_ENCL_TYPE fits into size_t. * xstormy16-tdep.c (xstormy16_push_dummy_call): Call value_contents earlier to ensure that the argument fits into host memory.