Page MenuHomeFreeBSD

Fix gcc unused value warnings in FreeBSD zfs_prop.c
AbandonedPublic

Authored by dim on Oct 27 2024, 2:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 7, 1:58 PM
Unknown Object (File)
Fri, Nov 29, 8:25 AM
Unknown Object (File)
Nov 25 2024, 12:51 AM
Unknown Object (File)
Nov 10 2024, 12:44 AM
Unknown Object (File)
Nov 1 2024, 11:39 AM
Unknown Object (File)
Nov 1 2024, 11:39 AM
Unknown Object (File)
Nov 1 2024, 11:28 AM
Unknown Object (File)
Oct 30 2024, 3:16 PM
Subscribers

Details

Reviewers
tsoome
mm
Summary

With gcc we are seeing the following -Werror warnings:

/workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h:53:33: error: statement with no effect [-Werror=unused-value]
   53 | #define simd_stat_init()        0
      |                                 ^
/workspace/src/sys/contrib/openzfs/module/zcommon/zfs_prop.c:1092:9: note: in expansion of macro 'simd_stat_init'
 1092 |         simd_stat_init();
      |         ^~~~~~~~~~~~~~
/workspace/src/sys/contrib/openzfs/module/zcommon/zfs_prop.c: In function 'zcommon_fini':
/workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h:54:33: error: statement with no effect [-Werror=unused-value]
   54 | #define simd_stat_fini()        0
      |                                 ^
/workspace/src/sys/contrib/openzfs/module/zcommon/zfs_prop.c:1100:9: note: in expansion of macro 'simd_stat_fini'
 1100 |         simd_stat_fini();
      |         ^~~~~~~~~~~~~~

Both simd_stat_init() and simd_stat_fini() are defined in the FreeBSD
specific version of simd.h:

#define	simd_stat_init()	0
#define	simd_stat_fini()	0

These should both be defined as do {} while (0)" instead, similar to
other macros in this file.

Diff Detail

Repository
rG FreeBSD src repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 60206
Build 57090: arc lint + arc unit