[cfe-commits] [PATCH] Strftime and "non literal format"
Jean-Daniel Dupas
devlists at shadowlab.org
Tue Feb 7 02:00:47 PST 2012
Yes, we already have a check to enforce it.
To be exact, when declaring the attribute like this: __attribute__(format(strftime, fmt_idx, arg_idx)))
clang will emit an error if the arg_idx parameter is not 0.
Le 7 févr. 2012 à 10:43, Joerg Sonnenberger a écrit :
> On Thu, Feb 02, 2012 at 10:28:03AM +0100, Jean-Daniel Dupas wrote:
>>
>> I'm wondering if it is right to emit warnings when using a non literal string in strftime function.
>> Unlike other format functions, this one takes only 1 single mandatory argument that represents the time we want to format.
>> So, unlike other format functions, it should not be 'unsafe' to pass an arbitrary string.
>
> I agree for strftime. The question is, does every possible user of the
> strftime format have this property.
>
> Joerg
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
-- Jean-Daniel
More information about the cfe-commits
mailing list