On 01/02/2017 10:28 PM, Alexandre Oliva wrote:
In stage2 of bootstrap-O1, the code that warns if sprintf might
overflow its output buffer cannot tell that an unsigned value narrowed
to 16 bits will fit in 4 bytes with %4x.
I couldn't find a better way to avoid the warning at -O1 than growing
the buffer so that there's no doubt the output will fit.
Regstrapped on x86_64-linux-gnu and i686-linux-gnu. Ok to install?
for gcc/c-family/ChangeLog
* c-pretty-print.c (pp_c_tree_decl_identifier): Grow static
buffer to avoid false-positive warning.
Presumably this is an artifact of not running VRP at -O1 and thus we
don't have a narrowed range from the masking operation.
This isn't performance critical code so we *could* avoid the statically
sized array. But I doubt it's worth the effort.
OK for the trunk.
jeff