Makefile: Temporarily suppress -Werror=unused-result
cover Makefile: Temporarily suppress -Werror=unused-result
This patch adds -Wno-error=unused-result to the Makefile to allow rt-tests to build on glibc >= 2.41, where functions like write(), system(), and ftruncate() are annotated with warn_unused_result. The build currently fails due to these ignored return values being treated as fatal errors under -Werror.
This change serves as a temporary workaround. A follow-up patch will address proper error checking at each affected call site.
Thanks.
-chengyang
---
Cheng-Yang Chou (1):
Makefile: Use -Wno-error=unused-result
Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.48.1
PATCH 1/1 Makefile: Use -Wno-error=unused-result
Since compile warnings are treated as errors, use -Wno-error=unused-result to avoid build failures caused by ignored return values from functions like write(), system(), and ftruncate(). This allows the build to succeed until proper error handling can be added where appropriate.
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -33,7 +33,7 @@ prefix ?= /usr/local bindir ?= $(prefix)/bin mandir ?= $(prefix)/share/man -CFLAGS ?= -Wall -Werror -Wno-nonnull -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-error=format-truncation= +CFLAGS ?= -Wall -Werror -Wno-nonnull -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-error=format-truncation= -Wno-error=unused-result CPPFLAGS += -D_GNU_SOURCE -Isrc/include LDFLAGS ?=
Signature · 1 line
2.48.1
Re: [PATCH 1/1] Makefile: Use -Wno-error=unused-result
Quoted 28 lines · Cheng-Yang Chou
Since compile warnings are treated as errors, use -Wno-error=unused-result to avoid build failures caused by ignored return values from functions like
write(),system(), andftruncate(). This allows the build to succeed until proper error handling can be added where appropriate.Signed-off-by Cheng-Yang Chou <[email protected]>--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Makefile +1
-1@@ -33,7 +33,7 @@ prefix ?= /usr/local bindir ?= $(prefix)/bin mandir ?= $(prefix)/share/man -CFLAGS ?= -Wall -Werror -Wno-nonnull -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-error=format-truncation= +CFLAGS ?= -Wall -Werror -Wno-nonnull -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-error=format-truncation= -Wno-error=unused-result CPPFLAGS += -D_GNU_SOURCE -Isrc/include LDFLAGS ?=Signature · 1 line
2.48.1
Quoted 5 lines · Cheng-Yang Chou
Cheng-Yang Chou (1):
Makefile: Use -Wno-error=unused-resultMakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Hi Clark and John,
Gentle ping.
Please let me know if any changes are needed.
Thanks.
-chengyang