Using both wchar_t and GCC __attribute__((format(...)))

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

 



Hello,

I am trying to convert some functions in my library from (char *) to
(wchar_t *), and it has been a bit of a nightmare. I want to use GCC error
detection for printf-style functions, but that doesn't seem to work when
functions use wchar_t *. For instance:

void trace(conn_t *, wchar_t *, ...)
       __attribute__ ((format(printf, 2, 3)));

And GCC aborts with:

"error: format string argument not a string type"

Then I tried something like:

void trace(conn_t *, wchar_t *, ...)
       __attribute__ ((format(wprintf, 2, 3)));

But GCC tells me that:

"warning: 'wprintf' is an unrecognized format function type"

Which I assume will disable GCC printf-style error checking.

How do I solve this other than disabling this feature completely?
Any help would be greatly appreciated.

Cheers,
Pedro.

--
Pedro de Medeiros - Ciência da Computação - Universidade de Brasília
Home Page: http://www.nonseq.net - Linux User No.: 234250
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux