Skip to content

Commit bb69a2f

Browse files
committed
c23: use now-standard [[nodiscard]] in favor of compiler attribute
1 parent 6495f40 commit bb69a2f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

libtock/tock.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,25 +194,25 @@ yield_waitfor_return_t yield_wait_for(uint32_t driver, uint32_t subscribe);
194194
void tock_exit(uint32_t completion_code) __attribute__ ((noreturn));
195195
void tock_restart(uint32_t completion_code) __attribute__ ((noreturn));
196196

197-
__attribute__ ((warn_unused_result))
197+
[[ nodiscard ]]
198198
syscall_return_t command(uint32_t driver, uint32_t command, int arg1, int arg2);
199199

200200
// Pass this to the subscribe syscall as a function pointer to
201201
// be the Null Upcall.
202202
#define TOCK_NULL_UPCALL 0
203203

204-
__attribute__ ((warn_unused_result))
204+
[[ nodiscard ]]
205205
subscribe_return_t subscribe(uint32_t driver, uint32_t subscribe, subscribe_upcall uc, void* userdata);
206206

207-
__attribute__ ((warn_unused_result))
207+
[[ nodiscard ]]
208208
allow_rw_return_t allow_readwrite(uint32_t driver, uint32_t allow, void* ptr, size_t size);
209209

210-
__attribute__ ((warn_unused_result))
210+
[[ nodiscard ]]
211211
allow_userspace_r_return_t allow_userspace_read(uint32_t driver,
212212
uint32_t allow, void* ptr,
213213
size_t size);
214214

215-
__attribute__ ((warn_unused_result))
215+
[[ nodiscard ]]
216216
allow_ro_return_t allow_readonly(uint32_t driver, uint32_t allow, const void* ptr, size_t size);
217217

218218
// Call the memop syscall.

0 commit comments

Comments
 (0)