[Bug c/53612] New: __attribute__((format(...))) does not work with wchar_t format strings

vhaisman at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Jun 8 11:07:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53612

             Bug #: 53612
           Summary: __attribute__((format(...))) does not work with
                    wchar_t format strings
    Classification: Unclassified
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vhaisman@gmail.com


The __attribute__((format(...))) does not work for wchar_t format strings:

/*-------------8<--------------*/
#include <wchar.h>

void foo (char const * fmt, ...) __attribute__ ((format (__printf__, 1, 2)));
void wide_foo (wchar_t const * fmt, ...) __attribute__ ((format (__printf__, 1,
2)));
/*-------------8<--------------*/

I get the following error with Cygwin's GCC 4.5.3:

./format_attr_text.c:4:1: error: format string argument not a string type



More information about the Gcc-bugs mailing list