Skip to content
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

CONC-766: Disable clang -Wcast-function-type-strict for makecontext #274

Open
wants to merge 1 commit into
base: 3.1
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions libmariadb/ma_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,21 @@ my_context_spawn(struct my_context *c, void (*f)(void *), void *d)
c->user_data= d;
c->active= 1;
u.p= c;
/*
makecontext function expects function pointer to receive multiple
ints as an arguments, however is declared in ucontext.h header with
a void (empty) argument list. Ignore clang cast-function-type-strict
warning for this function call.
*/
# ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wcast-function-type-strict"
# endif
makecontext(&c->spawned_context, (uc_func_t)my_context_spawn_internal, 2,
u.a[0], u.a[1]);
# ifdef __clang__
# pragma clang diagnostic pop
# endif

return my_context_continue(c);
}
Expand Down