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

Timo Sirainen <tss at iki dot fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tss at iki dot fi

--- Comment #3 from Timo Sirainen <tss at iki dot fi> 2012-01-10 20:38:44 UTC 
---
I ran into this as well. I tried two ways, neither of which works with strftime
(both work with printf):

static void __attribute__((format (strftime, 1, 0)))
test1(const char *fmt, const struct tm *tm)
{
    char buf[100];

    strftime(buf, sizeof(buf), fmt, tm);
}

static const char *__attribute__((format_arg (1)))
helper(const char *fmt)
{
    return fmt;
}

static void
test2(const char *fmt, const struct tm *tm)
{
    char buf[100];

    strftime(buf, sizeof(buf), helper(fmt), tm);
}

Reply via email to