This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/81840] Incorrect warning issued in arm-to-x86_64 cross compilation
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 13 Aug 2017 22:26:48 +0000
- Subject: [Bug c/81840] Incorrect warning issued in arm-to-x86_64 cross compilation
- Auto-submitted: auto-generated
- References: <bug-81840-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81840
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
CC| |msebor at gcc dot gnu.org
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
I don't see this with trunk (GCC 8.0) configured for the same target. The
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);