Skip to content

work-steal: fix incompatible pointer warning #20

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

Merged

Conversation

zondatw
Copy link
Contributor

@zondatw zondatw commented Aug 29, 2023

When building code, the compiler says:

work-steal.c: In function ‘take’:
work-steal.c:111:11: warning: assignment to ‘work_t *’ {aka ‘struct work_internal *’} from incompatible pointer type ‘_Atomic work_t *’ {aka ‘_Atomic struct work_internal *’} [-Wincompatible-pointer-types]
  111 |         x = atomic_load_explicit(&a->buffer[b % a->size], memory_order_relaxed);
      |           ^
work-steal.c: In function ‘push’:
work-steal.c:137:5: warning: initialization of ‘_Atomic work_t *’ {aka ‘_Atomic struct work_internal *’} from incompatible pointer type ‘work_t *’ {aka ‘struct work_internal *’} [-Wincompatible-pointer-types]
  137 |     atomic_store_explicit(&a->buffer[b % a->size], w, memory_order_relaxed);
      |     ^~~~~~~~~~~~~~~~~~~~~
work-steal.c: In function ‘steal’:
work-steal.c:151:11: warning: assignment to ‘work_t *’ {aka ‘struct work_internal *’} from incompatible pointer type ‘_Atomic work_t *’ {aka ‘_Atomic struct work_internal *’} [-Wincompatible-pointer-types]
  151 |         x = atomic_load_explicit(&a->buffer[t % a->size], memory_order_relaxed);
      |

@jserv jserv merged commit b0b56b0 into sysprog21:master Aug 29, 2023
@jserv
Copy link
Contributor

jserv commented Aug 29, 2023

Thank @zondatw for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants