warn_implicitconv. NXP CodeWarrior Development Studio
Iklan
Iklan
warn_implicitconv
If you enable this pragma, the compiler issues a warning message for implicitly converting either from signed int
to unsigned int
or vice versa. Listing 31-14 on page 480
provides an example.
Listing 31-14. Example of implicit conversions between signed int
and unsigned int
#pragma warn_impl_s2u_conv on signed int si; unsigned int ui; int main()
{
ui = si; /* WARNING */
si = ui; /* WARNING */
#pragma warn_impl_s2u_conv off
ui = si; /* OK */
si = ui; /* OK */
}
By default, this pragma is enabled.
31.23 warn_implicitconv
Controls the issuing of warning messages for all implicit arithmetic conversions.
Syntax
#pragma warn_implicitconv on | off | reset
Remarks
If you enable this pragma, the compiler issues a warning message for all implicit arithmetic conversions when the destination type might not represent the source value.
Listing 31-15 on page 480 provides an example.
Listing 31-15. Example of Implicit Conversion
#pragma warn_implicitconv on float f; signed int si; unsigned int ui; int main()
{
f = si; /* WARNING */
si = f; /* WARNING */
ui = si; /* WARNING */
si = ui; /* WARNING */
}
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
480 Freescale Semiconductor, Inc.
Unduh
Iklan