-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Occurs with GCC only when LTO is disabled and using opt level O1 and above.
In file included from sb16.c:6:
In function ‘list_add’,
inlined from ‘wait_queue_add’ at wait.h:99:5,
inlined from ‘sb16_read’ at sb16.c:183:12:
list.h:87:16: error: storing the address of local variable ‘__wait’ in ‘sb16_write_queue.next’ [-Werror=dangling-pointer=]
87 | head->next = node;
| ~~~~~~~~~~~^~~~~~
In file included from sb16.c:11:
sb16.c: In function ‘sb16_read’:
wait.h:22:17: note: ‘__wait’ declared here
22 | wait_node_t __wait; \
| ^~~~~~
wait.h:50:5: note: in expansion of macro ‘WAIT_IMPL’
50 | WAIT_IMPL(expr, queue, nonblocking, true)
| ^~~~~~~~~
sb16.c:183:12: note: in expansion of macro ‘WAIT_INTERRUPTIBLE’
183 | return WAIT_INTERRUPTIBLE(
| ^~~~~~~~~~~~~~~~~~
sb16.c:63:20: note: ‘sb16_write_queue’ declared here
63 | static list_define(sb16_write_queue);
| ^~~~~~~~~~~~~~~~
list.h:21:12: note: in definition of macro ‘list_define’
21 | list_t name = { .prev = &(name), .next = &(name) }
| ^~~~
In function ‘list_add’,
inlined from ‘wait_queue_add’ at wait.h:99:5,
inlined from ‘sb16_write’ at sb16.c:229:14:
list.h:87:16: error: storing the address of local variable ‘__wait’ in ‘sb16_write_queue.next’ [-Werror=dangling-pointer=]
87 | head->next = node;
| ~~~~~~~~~~~^~~~~~
sb16.c: In function ‘sb16_write’:
wait.h:22:17: note: ‘__wait’ declared here
22 | wait_node_t __wait; \
| ^~~~~~
wait.h:50:5: note: in expansion of macro ‘WAIT_IMPL’
50 | WAIT_IMPL(expr, queue, nonblocking, true)
| ^~~~~~~~~
sb16.c:229:14: note: in expansion of macro ‘WAIT_INTERRUPTIBLE’
229 | nbytes = WAIT_INTERRUPTIBLE(
| ^~~~~~~~~~~~~~~~~~
sb16.c:63:20: note: ‘sb16_write_queue’ declared here
63 | static list_define(sb16_write_queue);
| ^~~~~~~~~~~~~~~~
list.h:21:12: note: in definition of macro ‘list_define’
21 | list_t name = { .prev = &(name), .next = &(name) }
| ^~~~
Metadata
Metadata
Assignees
Labels
No labels