https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81840
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> --- (In reply to Martin Sebor from comment #1) > I don't see this with trunk (GCC 8.0) configured for the same target. The Was it fixed or did it become latent on trunk? > warning tends to be sensitive to char (and short) conversions because of > limitations in its integration with the Value Range Propagation pass. It's > possible that changes to it or to other areas have improved the quality of > the range info to avoid the warning. To avoid these false positives it's > best to use the length modifier most appropriate for the type of the > argument. I.e., in the gas source, use the %hhx directive like so: > > snprintf (output_invalid_buf, sizeof (output_invalid_buf), > "(0x%hhx)", (unsigned char) c); Does it work with all OSes and compilers binutils support?