Skip to content

clc: silence a warn_unused_result

What does this MR do and why?

clc: silence a warn_unused_result

Ignoring asprintf() return value leads to the following compiler warning:

src/compiler/clc/liblibmesaclc.a.p/clc.c.o -MF src/compiler/clc/liblibmesaclc.a.p/clc.c.o.d -o src/compiler/clc/liblibmesaclc.a.p/clc.c.o -c ../src/compiler/clc/clc.c
In file included from ../src/compiler/clc/clc.c:28:
../src/compiler/clc/clc.c: In function ‘clc_libclc_new’:
../src/compiler/clc/clc_helpers.h:99:7: warning: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   99 |       asprintf(&_msg, fmt, ##__VA_ARGS__);           \
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/compiler/clc/clc_helpers.h:105:37: note: in expansion of macro ‘clc_log’
  105 | #define clc_error(logger, fmt, ...) clc_log(logger, error, fmt, ##__VA_ARGS__)

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>

Merge request reports