[PATCH] Refactor attribute arguments

Aaron Ballman aaron at aaronballman.com
Mon Jul 29 17:54:14 PDT 2013


Thanks!  Committed in r187398

~Aaron

On Mon, Jul 29, 2013 at 7:50 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
> LGTM.  Sorry about the delay.
>
> -Eli
>
> On Mon, Jul 29, 2013 at 6:19 AM, Aaron Ballman <aaron at aaronballman.com> wrote:
>> Ping?
>>
>> On Tue, Jul 23, 2013 at 10:06 AM, Aaron Ballman <aaron at aaronballman.com> wrote:
>>> LGTY then?
>>>
>>> ~Aaron
>>>
>>> On Mon, Jul 22, 2013 at 5:44 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
>>>> On Mon, Jul 22, 2013 at 2:37 PM, Aaron Ballman <aaron at aaronballman.com> wrote:
>>>>> My testing showed it to be the case -- when using the index returned
>>>>> from checkFunctionOrMethodArgumentIndex, it was always off by one or
>>>>> two depending on context.  Specifically:
>>>>>
>>>>> const char* g2(const char*) __attribute__((format_arg(2)));
>>>>>
>>>>> checkFunctionOrMethodIndex would return index 0 because it cares about
>>>>> the const char * -- adding 1 to it when passing in the argument to
>>>>> addAttr (to make it one based instead of zero based) was not
>>>>> sufficient; I would get crashes in other parts of the system for that
>>>>> test case.  Having it pass in two is consistent with the previous
>>>>> behavior.
>>>>
>>>> Oh, right... checkFunctionOrMethodArgumentIndex is performing the
>>>> conversion, but Sema for format attributes expects the unconverted
>>>> version.  We should probably clean that up at some point, but that
>>>> shouldn't block this patch.
>>>>
>>>> -Eli



More information about the cfe-commits mailing list