[cfe-dev] feature request: support format attribute for non-variadic functions

Kal b17c0de at gmail.com
Sat Feb 15 01:53:12 PST 2014


Hi,
It would useful to allow the __format__ attribute on non-variadic
functions. For example:

template<typename... Arguments>
__attribute__ ((__format__ (__printf__, 1, 2)))
inline auto format(const char *Fmt, Arguments&&... Args) {
  return format_object<Arguments...>(Fmt, std::forward<Arguments>(Args)...);
}

When I try to compile this with clang I get error: "format attribute
requires variadic function".

Is there any reason why this shouldn't be allowed?

Thanks,
Kal



More information about the cfe-dev mailing list