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

[AOT] Fix warning on dropping const in TVMAotExecutor_GetInputName #14529

Merged
merged 2 commits into from
Apr 13, 2023

Conversation

Lunderberg
Copy link
Contributor

Prior to this commit, the TVMAotExecutor_GetInputName function accepted a char** name output parameter. When used, assignment of a const char* into *name dropped the const, resulting in a warning. Changing the argument type to const char** (pointer to a mutable pointer to a const char) resolves this warning.

Prior to this commit, the `TVMAotExecutor_GetInputName` function
accepted a `char** name` output parameter.  When used, assignment of a
`const char*` into `*name` dropped the `const`, resulting in a
warning.  Changing the argument type to `const char**` (pointer to a
mutable pointer to a `const char`) resolves this warning.
@tvm-bot
Copy link
Collaborator

tvm-bot commented Apr 7, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@kparzysz-quic kparzysz-quic merged commit 68ce1e8 into apache:main Apr 13, 2023
@Lunderberg Lunderberg deleted the aot_const_char_warning branch April 13, 2023 17:20
Lunderberg added a commit to Lunderberg/tvm that referenced this pull request Jul 5, 2023
The `TVMAotExecutor_GetInputName` function requires a `const char**`,
but is provided with a `char**`.  While C's automatic pointer
conversion does allow this as an automatic conversion, following
const-correctness avoids a compile-time warning.

This warning was first caused following
apache#14529, which itself was to follow
const-correctness within the implementation of
`TVMAotExecutor_GetInputName`.
Lunderberg added a commit to Lunderberg/tvm that referenced this pull request May 23, 2024
The `TVMAotExecutor_GetInputName` function requires a `const char**`,
but is provided with a `char**`.  While C's automatic pointer
conversion does allow this as an automatic conversion, following
const-correctness avoids a compile-time warning.

This warning was first caused following
apache#14529, which itself was to follow
const-correctness within the implementation of
`TVMAotExecutor_GetInputName`.
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