[Intel-gfx] [PATCH i-g-t 1/3] lib/core: Avoid unused result in backtrace printing

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Fri Nov 3 12:04:15 UTC 2017


On 03/11/2017 11:52, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2017-11-03 11:47:54)
>> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
>>
>> Add helpers for direct write to stderr to consolidate the code
>> and avoid the unused result warning in build.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
>> ---
>>   lib/igt_core.c | 23 ++++++++++++++++-------
>>   1 file changed, 16 insertions(+), 7 deletions(-)
>>
>> diff --git a/lib/igt_core.c b/lib/igt_core.c
>> index 538a4472e209..351859eaa04c 100644
>> --- a/lib/igt_core.c
>> +++ b/lib/igt_core.c
>> @@ -1239,7 +1239,7 @@ static const char hex[] = "0123456789abcdef";
>>   static void
>>   xputch(int c)
>>   {
>> -       write(STDERR_FILENO, (const void *) &c, 1);
>> +       igt_assert_eq(write(STDERR_FILENO, (const void *) &c, 1), 1);
> 
> Infinite recursion, you can't use an assert from inside the assert
> handler.

I thought it is the signal handler. Tested sending some signals and it 
survived. If there is a flaw there could instead nerf them with void 
cast, don't know.

Tvrtko



More information about the Intel-gfx mailing list