warn_pch_portability. NXP CodeWarrior Development Studio
Reklama
Reklama
Chapter 31 Pragmas for Diagnostic Messages
31.28 warn_pch_portability
Controls whether or not to issue a warning message when
#pragmaonceon
is used in a precompiled header.
Syntax
#pragma warn_pch_portability on | off | reset
Remarks
If you enable this pragma, the compiler issues a warning message when you use
#pragma once on
in a precompiled header. This helps you avoid situations in which transferring a precompiled header from machine to machine causes the precompiled header to produce different results. For more information, see pragma once
.
This pragma does not correspond to any panel setting. By default, this setting is off
.
31.29 warn_possunwant
Controls the recognition of possible unintentional logical errors.
Syntax
#pragma warn_possunwant on | off | reset
Remarks
If you enable this pragma, the compiler checks for common, unintended logical errors:
• An assignment in either a logical expression or the conditional portion of an if
, while
, or for
expression. This warning message is useful if you use
=
when you mean to use
==
. The listing below shows an example.
Listing 31-18. Confusing = and == in Comparisons
if (a=b) f(); /* WARNING: a=b is an assignment. */ if ((a=b)!=0) f(); /* OK: (a=b)!=0 is a comparison. */ if (a==b) f(); /* OK: (a==b) is a comparison. */
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
Freescale Semiconductor, Inc.
483
Atsisiųsti
Reklama