Skip to content

selftests/sched_ext: Fix unused-result warning for read()

Cheng-Yang Chou sched-ext 1 version Applied

Status from this message: Applied to sched_ext/for-7.0-fixes.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/1selftests/sched_ext: Fix unused-result warning for read()tools/testing/selftests/sched_ext/init_enable_count.c+2 -11 reply
1/1selftests/sched_ext: Fix unused-result warning for read()tools/testing/selftests/sched_ext/init_enable_count.c+2 -10 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchAndrea Righi
1/1R-b R-b
1/1R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/1] selftests/sched_ext: Fix unused-result warning for read()

The build fails under -Werror because read() ignores its return value, triggering a warn_unused_result compiler error:

init_enable_count.c: In function ‘run_test’:
init_enable_count.c:60:25: error: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]

   60 |                         read(pipe_fds[0], &buf, 1);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as error

Check the return value of read() to satisfy the compiler and catch unexpected pipe failures.

Thanks,
cheng-yang

---

Cheng-Yang Chou (1):
selftests/sched_ext: Fix unused-result warning for read()

 tools/testing/selftests/sched_ext/init_enable_count.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.48.1