Declaring a function to be of wprintf style

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I attempted this:

#ifdef __GNUC__
#define PAW__ATTR_PRINTF(ARGS_POS,VA_POS) \
    __attribute__((format (printf, ARGS_POS, VA_POS)))
#define PAW__ATTR_WPRINTF(ARGS_POS,VA_POS) \
    __attribute__((format (wprintf, ARGS_POS, VA_POS)))
#else
#define PAW__ATTR_PRINTF(ARGS_POS,VA_POS)
#define PAW__ATTR_WPRINTF(ARGS_POS,VA_POS)
#endif

#ifdef _DEBUG
#define PAW_ATTR_PRINTF(ARGS_POS,VA_POS) PAW__ATTR_PRINTF(ARGS_POS,VA_POS)
#define PAW_ATTR_WPRINTF(ARGS_POS,VA_POS) PAW__ATTR_WPRINTF(ARGS_POS,VA_POS)
#else
#define PAW_ATTR_PRINTF(ARGS_POS,VA_POS)
#define PAW_ATTR_WPRINTF(ARGS_POS,VA_POS)
#endif

But gcc gave this "error: ‘wprintf’ is an unrecognized format function
type", I also tried just printf but then it complained the args
parameter was not of char const *

Is there anyway to declare it to be of that style and if so is there a
way to extend what it checks for as I have some custom modifiers for
the string types & and some extra specifiers, 3 of which can change
what is expected to be found in the args, namely what options are
sought out, what modifiers are sought out and what specifiers are
sought out, I would greatly appreciate being able to get my arguments
checked for type mis-matches in the default scenarios during compile
time




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux