5.38 __scanf_args Pragma

Use this pragma directive on a function with a printf-style format string. For any call to that function, the compiler verifies that the argument to each conversion specifier, for example %d, is syntactically correct.

Suggested Replacement

Not officially supported by XC32 (contradicts IAR compatibility chart but use of attribute is not documented).

Caveats

None.

Examples

Consider migrating IAR code such as:
#pragma __scanf_args 
int scanf(char const *,...);  

int GetNumber() 
{ 
  int nr; 
  scanf("%d", &nr);  /* Compiler checks 
   return nr;  
}
to MPLAB XC codes similar to:
extern int 
          my_printf (void *my_object, const char *my_format, ...) 
                __attribute__ ((format (printf, 2, 3)));

Further Information

None.