[GCC] build failure due to warn_unused_result
GCC fails to build due to warn_unused_result.
- waypipe version: 0.6.1
- GCC version: 8.3.0
Here is the meson's output.
The Meson build system
Version: 0.51.2
Source dir: /tmp/tmp.MZQc7NRkb0/waypipe
Build dir: /tmp/tmp.MZQc7NRkb0/build-waypipe
Build type: native build
Project name: waypipe
Project version: 0.6.1
C compiler for the host machine: cc (gcc 8.3.0 "cc (Gentoo 8.3.0-r1 p1.1) 8.3.0")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Program python3 found: YES (/usr/bin/python3.6)
Compiler for C supports arguments -fmacro-prefix-map=/prefix/to/hide=: YES
Found pkg-config: /usr/bin/pkg-config (1.6.3)
Run-time dependency gbm found: YES 19.2.0
Run-time dependency libdrm found: YES 2.4.99
Run-time dependency threads found: YES
Library rt found: YES
Has header "sys/sdt.h" : NO
Found CMake: /usr/bin/cmake (3.14.6)
Run-time dependency liblz4 found: NO (tried pkgconfig and cmake)
Run-time dependency libzstd found: NO (tried pkgconfig and cmake)
Run-time dependency libavcodec found: YES 58.35.100
Run-time dependency libavutil found: YES 56.22.100
Run-time dependency libswscale found: YES 5.3.100
Run-time dependency libva found: NO (tried pkgconfig and cmake)
Run-time dependency wayland-protocols found: YES 1.18
Run-time dependency wayland-client found: YES 1.17.0
Compiler for C supports arguments -mavx512f: YES
Compiler for C supports arguments -mlzcnt: YES
Compiler for C supports arguments -mbmi: YES
Compiler for C supports arguments -mavx2: YES
Compiler for C supports arguments -mlzcnt: YES (cached)
Compiler for C supports arguments -mbmi: YES (cached)
Compiler for C supports arguments -msse3: YES
Compiler for C supports arguments -mfpu=neon: NO
Configuring config-waypipe.h using configuration
Run-time dependency weston found: NO (tried pkgconfig and cmake)
Program weston found: NO
Program weston-simple-shm found: NO
Program weston-simple-dmabuf-drm found: NO
Program weston-terminal found: NO
Program weston-presentation-shm found: NO
Program weston-subsurfaces found: NO
Found pkg-config: /usr/bin/pkg-config (1.6.3)
Found CMake: /usr/bin/cmake (3.14.6)
Build-time dependency scdoc found: NO (tried pkgconfig and cmake)
Build targets in project: 37
Found ninja-1.8.2 at /usr/bin/ninja
Here is the ninja's output.
ninja: Entering directory `build-waypipe'
[1/73] Generating __usr_share_wayland_protocols_stable_xdg_shell_xdg_shell_xml code with a custom command.
[2/73] Generating __usr_share_wayland_protocols_stable_xdg_shell_xdg_shell_xml client-header with a custom command.
[3/73] Generating _usr_share_wayland_wayland_xml code with a custom command.
[4/73] Generating __usr_share_wayland_protocols_stable_presentation_time_presentation_time_xml code with a custom command.
[5/73] Generating _usr_share_wayland_wayland_xml client-header with a custom command.
[6/73] Generating __usr_share_wayland_protocols_stable_presentation_time_presentation_time_xml client-header with a custom command.
[7/73] Generating gtk_primary_selection_xml code with a custom command.
[8/73] Generating __usr_share_wayland_protocols_unstable_linux_dmabuf_linux_dmabuf_unstable_v1_xml code with a custom command.
[9/73] Generating input_method_unstable_v2_xml code with a custom command.
[10/73] Generating __usr_share_wayland_protocols_unstable_linux_dmabuf_linux_dmabuf_unstable_v1_xml client-header with a custom command.
[11/73] Generating gtk_primary_selection_xml client-header with a custom command.
[12/73] Generating virtual_keyboard_unstable_v1_xml code with a custom command.
[13/73] Generating input_method_unstable_v2_xml client-header with a custom command.
[14/73] Generating virtual_keyboard_unstable_v1_xml client-header with a custom command.
[15/73] Generating wlr_screencopy_unstable_v1_xml code with a custom command.
[16/73] Generating wlr_export_dmabuf_unstable_v1_xml client-header with a custom command.
[17/73] Generating wlr_screencopy_unstable_v1_xml client-header with a custom command.
[18/73] Generating wlr_export_dmabuf_unstable_v1_xml code with a custom command.
[19/73] Generating wlr_data_control_unstable_v1_xml code with a custom command.
[20/73] Generating wlr_data_control_unstable_v1_xml client-header with a custom command.
[21/73] Generating wayland_drm_xml client-header with a custom command.
[22/73] Compiling C object 'protocols/8998617@@protocols@sta/meson-generated_.._xdg-shell-data.c.o'.
[23/73] Generating wayland_drm_xml code with a custom command.
[24/73] Compiling C object 'protocols/8998617@@protocols@sta/meson-generated_.._presentation-time-data.c.o'.
[25/73] Compiling C object 'protocols/8998617@@protocols@sta/meson-generated_.._wayland-data.c.o'.
[26/73] Compiling C object 'protocols/8998617@@protocols@sta/meson-generated_.._gtk-primary-selection-data.c.o'.
[27/73] Compiling C object 'protocols/8998617@@protocols@sta/meson-generated_.._linux-dmabuf-unstable-v1-data.c.o'.
[28/73] Compiling C object 'protocols/8998617@@protocols@sta/meson-generated_.._input-method-unstable-v2-data.c.o'.
[29/73] Compiling C object 'protocols/8998617@@protocols@sta/meson-generated_.._virtual-keyboard-unstable-v1-data.c.o'.
[30/73] Compiling C object 'protocols/8998617@@protocols@sta/meson-generated_.._wlr-screencopy-unstable-v1-data.c.o'.
[31/73] Compiling C object 'protocols/8998617@@protocols@sta/meson-generated_.._wlr-export-dmabuf-unstable-v1-data.c.o'.
[32/73] Compiling C object 'protocols/8998617@@protocols@sta/meson-generated_.._wlr-data-control-unstable-v1-data.c.o'.
[33/73] Compiling C object 'protocols/8998617@@protocols@sta/meson-generated_.._wayland-drm-data.c.o'.
[34/73] Linking static target protocols/libprotocols.a.
[35/73] Compiling C object 'src/25a6634@@waypipe_src@sta/dmabuf.c.o'.
[36/73] Compiling C object 'src/25a6634@@kernel_sse3@sta/kernel_sse3.c.o'.
[37/73] Linking static target src/libkernel_sse3.a.
[38/73] Compiling C object 'src/25a6634@@waypipe_src@sta/kernel.c.o'.
[39/73] Compiling C object 'src/25a6634@@kernel_avx2@sta/kernel_avx2.c.o'.
[40/73] Compiling C object 'src/25a6634@@waypipe_src@sta/platform.c.o'.
[41/73] Linking static target src/libkernel_avx2.a.
[42/73] Compiling C object 'src/25a6634@@kernel_avx512f@sta/kernel_avx512f.c.o'.
[43/73] Linking static target src/libkernel_avx512f.a.
[44/73] Compiling C object 'src/25a6634@@waypipe_src@sta/handlers.c.o'.
[45/73] Compiling C object 'src/25a6634@@waypipe_src@sta/parsing.c.o'.
[46/73] Compiling C object 'src/25a6634@@waypipe_src@sta/interval.c.o'.
[47/73] Compiling C object 'src/25a6634@@waypipe_src@sta/util.c.o'.
FAILED: src/25a6634@@waypipe_src@sta/util.c.o
cc -Isrc/25a6634@@waypipe_src@sta -Isrc -I../waypipe/src -Iprotocols -I../waypipe/protocols -I/usr/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c11 -O2 -g -D_DEFAULT_SOURCE -fmacro-prefix-map=../waypipe/= -fPIC -pthread -MD -MQ 'src/25a6634@@waypipe_src@sta/util.c.o' -MF 'src/25a6634@@waypipe_src@sta/util.c.o.d' -o 'src/25a6634@@waypipe_src@sta/util.c.o' -c ../waypipe/src/util.c
../waypipe/src/util.c: In function ‘handle_sigint’:
../waypipe/src/util.c:50:8: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
(void)write(STDOUT_FILENO, buf, strlen(buf));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../waypipe/src/util.c:55:9: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
(void)write(STDERR_FILENO, msg, sizeof(msg));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../waypipe/src/util.c: In function ‘test_atomic_log_handler’:
../waypipe/src/util.c:195:8: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
(void)write(STDOUT_FILENO, msg, (size_t)nwri);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
[48/73] Compiling C object 'src/25a6634@@waypipe_src@sta/mainloop.c.o'.
FAILED: src/25a6634@@waypipe_src@sta/mainloop.c.o
cc -Isrc/25a6634@@waypipe_src@sta -Isrc -I../waypipe/src -Iprotocols -I../waypipe/protocols -I/usr/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c11 -O2 -g -D_DEFAULT_SOURCE -fmacro-prefix-map=../waypipe/= -fPIC -pthread -MD -MQ 'src/25a6634@@waypipe_src@sta/mainloop.c.o' -MF 'src/25a6634@@waypipe_src@sta/mainloop.c.o.d' -o 'src/25a6634@@waypipe_src@sta/mainloop.c.o' -c ../waypipe/src/mainloop.c
../waypipe/src/mainloop.c: In function ‘main_interface_loop’:
../waypipe/src/mainloop.c:1298:10: error: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Werror=unused-result]
(void)read(g.threads.selfpipe_r, tmp, sizeof(tmp));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
[49/73] Compiling C object 'src/25a6634@@waypipe@exe/bench.c.o'.
FAILED: src/25a6634@@waypipe@exe/bench.c.o
cc -Isrc/25a6634@@waypipe@exe -Isrc -I../waypipe/src -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c11 -O2 -g -D_DEFAULT_SOURCE -fmacro-prefix-map=../waypipe/= -MD -MQ 'src/25a6634@@waypipe@exe/bench.c.o' -MF 'src/25a6634@@waypipe@exe/bench.c.o.d' -o 'src/25a6634@@waypipe@exe/bench.c.o' -c ../waypipe/src/bench.c
../waypipe/src/bench.c: In function ‘run_sub_bench’:
../waypipe/src/bench.c:236:10: error: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Werror=unused-result]
(void)read(pool.selfpipe_r, flush, sizeof(flush));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
[50/73] Compiling C object 'src/25a6634@@waypipe_src@sta/video.c.o'.
[51/73] Compiling C object 'src/25a6634@@waypipe@exe/waypipe.c.o'.
FAILED: src/25a6634@@waypipe@exe/waypipe.c.o
cc -Isrc/25a6634@@waypipe@exe -Isrc -I../waypipe/src -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c11 -O2 -g -D_DEFAULT_SOURCE -fmacro-prefix-map=../waypipe/= -MD -MQ 'src/25a6634@@waypipe@exe/waypipe.c.o' -MF 'src/25a6634@@waypipe@exe/waypipe.c.o.d' -o 'src/25a6634@@waypipe@exe/waypipe.c.o' -c ../waypipe/src/waypipe.c
../waypipe/src/waypipe.c: In function ‘log_handler’:
../waypipe/src/waypipe.c:162:8: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
(void)write(STDERR_FILENO, msg, (size_t)nwri);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
[52/73] Compiling C object 'src/25a6634@@waypipe_src@sta/shadow.c.o'.
ninja: build stopped: subcommand failed.
This is a relevent discussion in GCC's bugzilla.