linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Using both wchar_t and GCC __attribute__((format(...)))
@ 2007-07-02 19:52 Pedro de Medeiros
  2007-07-03  4:03 ` cyon.john
  0 siblings, 1 reply; 2+ messages in thread
From: Pedro de Medeiros @ 2007-07-02 19:52 UTC (permalink / raw)
  To: linux-c-programming

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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-03  4:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-02 19:52 Using both wchar_t and GCC __attribute__((format(...))) Pedro de Medeiros
2007-07-03  4:03 ` cyon.john

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).