FS/XFS testing framework
 help / color / mirror / Atom feed
* [PATCH] include/builddefs.in: ignore unused-result warning
@ 2025-01-06  9:59 Shiyang Ruan
  2025-01-15  9:15 ` Shiyang Ruan
  2025-01-15 15:33 ` Zorro Lang
  0 siblings, 2 replies; 8+ messages in thread
From: Shiyang Ruan @ 2025-01-06  9:59 UTC (permalink / raw)
  To: fstests; +Cc: ruansy.fnst

When build xfstests, a lot of "unused result" warning are reported:

    [CC] write_log.lo
write_log.c: In function 'wlog_record_write':
write_log.c:205:13: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
  205 |             write(wfile->w_afd, wbuf, reclen);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
write_log.c:209:13: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
  209 |             write(wfile->w_rfd, wbuf, reclen);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    [CC] random.lo

Mostly are calused by not using the return value of read()/write()/...
Ignore this warning by adding `-Wno-unused-result` to CCFLAGS.  This
won't cause other problem but make the log clean.

Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
---
 include/builddefs.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/builddefs.in b/include/builddefs.in
index 7274cde8d..edf87ff00 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -75,7 +75,7 @@ HAVE_RLIMIT_NOFILE = @have_rlimit_nofile@
 NEED_INTERNAL_XFS_IOC_EXCHANGE_RANGE = @need_internal_xfs_ioc_exchange_range@
 HAVE_FICLONE = @have_ficlone@
 
-GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall
+GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall -Wno-unused-result
 
 ifeq ($(PKG_PLATFORM),linux)
 PCFLAGS = -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 $(GCCFLAGS)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-01-17  5:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-06  9:59 [PATCH] include/builddefs.in: ignore unused-result warning Shiyang Ruan
2025-01-15  9:15 ` Shiyang Ruan
2025-01-15 15:33 ` Zorro Lang
2025-01-15 21:45   ` Darrick J. Wong
2025-01-17  4:11     ` Zorro Lang
2025-01-16  9:55   ` Shiyang Ruan
2025-01-17  4:01     ` Zorro Lang
2025-01-17  5:55       ` Shiyang Ruan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox