[igt-dev] [PATCH i-g-t 5/7] igt/params: add generic saving module parameter set

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Wed May 6 09:54:37 UTC 2020


On 6.5.2020 12.05, Arkadiusz Hiler wrote:
> On Tue, May 05, 2020 at 11:00:03PM +0300, Juha-Pekka Heikkila wrote:
>> On 5.5.2020 21.46, Juha-Pekka Heikkila wrote:
>>> On 5.5.2020 17.09, Arkadiusz Hiler wrote:
>>>> On Tue, Apr 28, 2020 at 11:22:53PM +0300, Juha-Pekka Heikkila wrote:
>>>>> From: Jani Nikula <jani.nikula at intel.com>
>>>>>
>>>>> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
>>>>> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
>>>>> ---
>>>>>    lib/igt_params.c | 57 ++++++++++++++++++++++++++++++++++++++++--------
>>>>>    lib/igt_params.h |  3 +++
>>>>>    2 files changed, 51 insertions(+), 9 deletions(-)
>>>>>
>>>>> diff --git a/lib/igt_params.c b/lib/igt_params.c
>>>>> index fe4b1df3..d9cf986c 100644
>>>>> --- a/lib/igt_params.c
>>>>> +++ b/lib/igt_params.c
>>>>> @@ -153,6 +153,29 @@ int igt_params_open(int device)
>>>>>        return __igt_params_open(device, NULL);
>>>>>    }
>>>>> +__attribute__((format(printf, 3, 0)))
>>>>
>>>> this is using a va_list, not "...", so this format attirbue should not
>>>> be here
>>>>
>>>
>>> Good catch
>>>
>>
>> Looking it with bit more thought, what's wrong with it? I think it is
>> required there.
> 
> I found it a bit useless that we do printf format checking without
> having any arugments to match types for as they are wrapped in va_list,
> but if compilers are screeming that it's necessary so be it.
> 
> Not sure what benefit does it provide though.

Benefit is not to get compiler warning which would be caused from later 
usage of vsnprintf. Other way to avoid it is to take out 
"missing-format-attribute" warnings.

va_list doesn't do anything here, parameter 3 is "const char *fmt". 
Va_list will not be touched.

/Juha-Pekka



More information about the igt-dev mailing list