Re: [PATCH 3/5] Let phex and phex_nz handle sizeof_l==1

Tom Tromey via Gdb-patches
2022-03-01T14:34:09Z

>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:

>> str = get_print_cell ();
>> xsnprintf (str, PRINT_CELL_SIZE, "%04x", (unsigned short) (l & 0xffff));
>> break;
>> + case 1:
>> + str = get_print_cell ();
>> + xsnprintf (str, PRINT_CELL_SIZE, "%02x", (unsigned short) (l & 0xff));

Simon> I'm just wondering why you're casting to unsigned short specifically (and not
Simon> unsigned char). But in practice it works, the patch LGTM.

I just copied the code above. I think any integer type that isn't wider
than "int" would be ok here, as they all get promoted.

Tom