This is an automated email from the ASF dual-hosted git repository.

kparzysz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 68ce1e871c [AOT] Fix warning on dropping const in 
TVMAotExecutor_GetInputName (#14529)
68ce1e871c is described below

commit 68ce1e871cbcd90789f462524ec0943bfee2ff0b
Author: Eric Lunderberg <[email protected]>
AuthorDate: Thu Apr 13 11:37:34 2023 -0500

    [AOT] Fix warning on dropping const in TVMAotExecutor_GetInputName (#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.
---
 include/tvm/runtime/crt/aot_executor.h      | 2 +-
 src/runtime/crt/aot_executor/aot_executor.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/tvm/runtime/crt/aot_executor.h 
b/include/tvm/runtime/crt/aot_executor.h
index 4783adec8e..693a66c3ae 100644
--- a/include/tvm/runtime/crt/aot_executor.h
+++ b/include/tvm/runtime/crt/aot_executor.h
@@ -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.
diff --git a/src/runtime/crt/aot_executor/aot_executor.c 
b/src/runtime/crt/aot_executor/aot_executor.c
index 8a47bb008b..9e733c21c3 100644
--- a/src/runtime/crt/aot_executor/aot_executor.c
+++ b/src/runtime/crt/aot_executor/aot_executor.c
@@ -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;

Reply via email to