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

user_context has inconsistent const qualifiers #635

Open
steven-johnson opened this issue Jan 22, 2015 · 1 comment
Open

user_context has inconsistent const qualifiers #635

steven-johnson opened this issue Jan 22, 2015 · 1 comment

Comments

@steven-johnson
Copy link
Contributor

Function declarations (from CodeGen_C.cpp) emit function prototypes with it declared as "const void_", but all the runtime callbacks declare it as "void_".

@steven-johnson
Copy link
Contributor Author

Update, several years later: amazingly, this usually isn't an issue, but:

  • If a define_extern() call references Halide-generated AOT code directly, and
  • The define_extern() call passes a user_context, and
  • c_plus_plus_name_mangling is enabled (for both caller and callee),

...we get link errors because of this dichotomy, since the caller expects void * but callee is defined as void const *.

Fixing this "correctly" (ie so that everything always uses identical types for user_context in all cases) will require a lot of downstream churn. Since the existing user_context design is already considered to be suboptimal in a number of ways (see #7298), it doesn't really make sense to try to spend effort to update this without addressing the other issues. #7291 is a somewhat awkward workaround to "fix" the link errors mentioned above, but definitely no better than a workaround.

steven-johnson added a commit that referenced this issue Jan 20, 2023
Add a workaround for the const-or-not user_context issue (#635)
ardier pushed a commit to ardier/Halide-mutation that referenced this issue Mar 3, 2024
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

No branches or pull requests

1 participant