Motorola DSP56800 Guía de usuario Pagina 417

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 446
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 416
Pragmas for the DSP56800 and DSP56800E
Pragma Reference
417Targeting MC56F83xx/DSP5685x Controllers
warn_any_ptr_int_conv
Controls if the compiler generates a warning when an integral type is explicitly
converted to a pointer type or vice versa.
Prototype
#pragma warn_any_ptr_int_conv on | off | reset
Remarks
This pragma is useful to identify potential pointer portability issues. An example is
shown in Listing C.20
.
Listing C.20 Example of warn_any_ptr_int_conv
#pragma warn_ptr_int_conv on
short i, *ip
void foo() {
i = (short)ip; // WARNING: integral type is not large
// large enough to hold pointer
}
#pragma warn_any_ptr_int_conv on
void bar() {
i = (int)ip; // WARNING: pointer to integral
// conversion
ip = (short *)i; // WARNING: integral to pointer
// conversion
}
See also warn_ptr_int_conv.
To check this setting, use
__option (warn_any_ptr_int_conv), described in
Checking Settings
By default, this pragma is off.
Vista de pagina 416
1 2 ... 412 413 414 415 416 417 418 419 420 421 422 ... 445 446

Comentarios a estos manuales

Sin comentarios