Skip to content

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

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
merged 1 commit into from
Apr 17, 2025

Conversation

grooverdan
Copy link
Contributor

makecontext has a defined prototype in ucontext.h that differs from its expected usage. Disable the clang warning for this function call.

Modelled off the af4498b commit.

makecontext has a defined prototype in ucontext.h that
differs from its expected usage. Disable the clang
warning for this function call.
@grooverdan grooverdan changed the title Disable clang -Wcast-function-type-strict for makecontext CONC-766: Disable clang -Wcast-function-type-strict for makecontext Apr 10, 2025
Copy link
Contributor

@knielsen knielsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch is ok.

An alternative might be to build with cmake arg -DWITH_BOOST_CONTEXT=ON. Then it will not try to use ucontext, even in address sanitizer build.

You might want to also remove this comment earlier in the file. Someone "Tildeslash" changed the code to remove the original fix for this function type mismatch without even bothering to fix (or even read?) the comment :-( :

/*
  We use old-style function definition here, as this is passed to
  makecontext(). And the type of the makecontext() argument does not match
  the actual type (as the actual type can differ from call to call).
*/

@grooverdan
Copy link
Contributor Author

The patch is ok.

Thank you.

An alternative might be to build with cmake arg -DWITH_BOOST_CONTEXT=ON. Then it will not try to use ucontext, even in address sanitizer build.

Rather stick to testing as close the code that is released as possible.

You might want to also remove this comment earlier in the file. Someone "Tildeslash" changed the code to remove the original fix for this function type mismatch without even bothering to fix (or even read?) the comment :-( :

/*
  We use old-style function definition here, as this is passed to
  makecontext(). And the type of the makecontext() argument does not match
  the actual type (as the actual type can differ from call to call).
*/

So belatedly maybe:

/*
   Note, the prototype of makecontext doesn't match the calling convention as
   the types of arguments can differ from call to call. Because of this, the warning 
  `Wcast-function-type-strict` is disabled below around setting up the callback to
  this function.
*/

@9EOR9 9EOR9 merged commit 867f0d1 into mariadb-corporation:3.1 Apr 17, 2025
1 of 2 checks passed
@grooverdan grooverdan deleted the makecontext branch April 17, 2025 07:33
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.

3 participants