Skip to content

Commit

Permalink
[AOT] Fix warning on dropping const in TVMAotExecutor_GetInputName (#…
Browse files Browse the repository at this point in the history
…14529)

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.
  • Loading branch information
Lunderberg authored Apr 13, 2023
1 parent 9e5055b commit 68ce1e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/tvm/runtime/crt/aot_executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ int TVMAotExecutor_GetInputIndex(TVMAotExecutor* executor, const char* name);
* \param name Output for retrieving name.
* \return Pointer to input name in `name`.
*/
int TVMAotExecutor_GetInputName(TVMAotExecutor* executor, int index, char** name);
int TVMAotExecutor_GetInputName(TVMAotExecutor* executor, int index, const char** name);

/*!
* \brief Run the generated program.
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/crt/aot_executor/aot_executor.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ int TVMAotExecutor_GetInputIndex(TVMAotExecutor* executor, const char* name) {
return rv;
}

int TVMAotExecutor_GetInputName(TVMAotExecutor* executor, int index, char** name) {
int TVMAotExecutor_GetInputName(TVMAotExecutor* executor, int index, const char** name) {
const TVMMetadata* md = executor->metadata;
*name = md->inputs[index].name;
return 0;
Expand Down

0 comments on commit 68ce1e8

Please sign in to comment.