-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: posix: timers: Fix unused function warning #87145
Conversation
Alternatively, we could mark the function with |
517d7bf
to
2f03db3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My preference would be to mark functions __used
, since it's a pretty elegant way of solving a common class of problems, and dead code in tests really isn't as much of a concern as dead code in deployed products.
2f03db3
to
01fb58d
Compare
@ycsin Can you take a look? Thanks! |
01fb58d
to
000d50d
Compare
000d50d
to
1b8cd2a
Compare
1b8cd2a
to
880e308
Compare
Building with clang warns: tests/posix/timers/src/clock.c:37:20: error: unused function 'tv_to_ts' [-Werror,-Wunused-function] static inline void tv_to_ts(const struct timeval *tv, struct timespec *ts) ^ tests/posix/timers/src/clock.c:51:16: error: unused function 'tp_eq' [-Werror,-Wunused-function] _decl_op(bool, tp_eq, ==); /* a == b */ ^ tests/posix/timers/src/clock.c:52:16: error: unused function 'tp_lt' [-Werror,-Wunused-function] _decl_op(bool, tp_lt, <); /* a < b */ ^ tests/posix/timers/src/clock.c:53:16: error: unused function 'tp_gt' [-Werror,-Wunused-function] _decl_op(bool, tp_gt, >); /* a > b */ ^ tests/posix/timers/src/clock.c:54:16: error: unused function 'tp_le' [-Werror,-Wunused-function] _decl_op(bool, tp_le, <=); /* a <= b */ tests/posix/timers/src/clock.c:59:20: error: unused function 'tp_diff_in_range_ns' [-Werror,-Wunused-function] static inline bool tp_diff_in_range_ns(const struct timespec *a, ^ const struct timespec *b, tests/posix/timers/src/clock.c:49:20: error: unused function 'tp_diff_in_range_ns' [-Werror,-Wunused-function] static inline bool tp_diff_in_range_ns(const struct timespec *a, ^ const struct timespec *b, Signed-off-by: Tom Hughes <tomhughes@chromium.org>
880e308
to
14adf68
Compare
Building with clang warns: