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

Chris Wilson chris at chris-wilson.co.uk
Fri Nov 3 11:52:34 UTC 2017


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.
-Chris


More information about the Intel-gfx mailing list