arocc icon indicating copy to clipboard operation
arocc copied to clipboard

Print _BitInt size in diagnostics

Open ehaas opened this issue 1 year ago • 0 comments

_BitInt(10) x = 1.2;

Currently our warning looks like this:

test.c:1:17: warning: implicit conversion from 'double' to '_BitInt' changes value from 1.2 to 1 [-Wfloat-conversion]
_BitInt(10) x = 1.2;
                ^

When it should be

test.c:1:17: warning: implicit conversion from 'double' to '_BitInt(10)' changes value from 1.2 to 1 [-Wfloat-conversion]
_BitInt(10) x = 1.2;
                ^
  1. Change the unsigned_bit_int_too_small, signed_bit_int_too_small, and bit_int_too_big messages to not take a string parameter.
  2. Change Builder.Specifier.str to return null for the _BitInt specifiers
  3. Handle _BitInt types in Type.printPrologue

ehaas avatar May 03 '24 17:05 ehaas