extended_errorcheck. NXP CodeWarrior Development Studio
Reklama
Reklama
Chapter 31
Pragmas for Diagnostic Messages
31.1 extended_errorcheck
Controls the issuing of warning messages for possible unintended logical errors.
Syntax
#pragma extended_errorcheck on | off | reset
Remarks
If you enable this pragma, the compiler generates a warning message (not an error) if it encounters some common programming errors:
It also issues a warning message when it encounters a delete operator for a class or structure that has not been defined yet. The listing below shows an example.
Listing 31-1. Attempting to delete an undefined structure
#pragma extended_errorcheck on struct X; int func(X *xp)
{
delete xp; // Warning: deleting incomplete type X
}
• An integer or floating-point value assigned to an enum
type. The listing below shows an example.
Listing 31-2. Assigning to an Enumerated Type
enum Day { Sunday, Monday, Tuesday, Wednesday,
Thursday, Friday, Saturday } d; d = 5; /* WARNING */ d = Monday; /* OK */ d = (Day)3; /* OK */
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
Freescale Semiconductor, Inc.
467
Stáhnout
Reklama