[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: toolchain/53618: bogus warnings from printf %u and ntohs with -O1
The following reply was made to PR toolchain/53618; it has been noted by GNATS.
From: Robert Elz <kre%munnari.OZ.AU@localhost>
Subject: Re: toolchain/53618: bogus warnings from printf %u and ntohs with -O1
Date: Sat, 22 Sep 2018 03:33:35 +0700
Date: Fri, 21 Sep 2018 11:20:01 +0000 (UTC)
From: Valery Ushakov <uwe%stderr.spb.ru@localhost>
| Isn't that what the 'h' length modifier (i.e. "%hu") is for?
No, 'h' truncates the int value provided to 16 bits, it doesn't prevent the
value being promoted from short to int in the first place. And yes, all of
this is bizarre, and gcc could be lots smarter about (almost all of) these
kinds of warnings ....
Main Index |
Thread Index |