Skip to content

Fix discarded-qualifiers Warning. - #232

Open
MeinhardZhou wants to merge 1 commit into
antirez:masterfrom
MeinhardZhou:master
Open

Fix discarded-qualifiers Warning.#232
MeinhardZhou wants to merge 1 commit into
antirez:masterfrom
MeinhardZhou:master

Conversation

@MeinhardZhou

Copy link
Copy Markdown
  • unsupporeted_term should be const char*
  • linenoiseEditMore should be const char*, but linenoiseEditFeed() return char *, so add a local heap-allocate variable.

Warning:

../thirdparty/linenoise/linenoise.c:122:36: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  122 | static char *unsupported_term[] = {"dumb","cons25","emacs",NULL};
      |                                    ^~~~~~
../thirdparty/linenoise/linenoise.c:122:43: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  122 | static char *unsupported_term[] = {"dumb","cons25","emacs",NULL};
      |                                           ^~~~~~~~
../thirdparty/linenoise/linenoise.c:122:52: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  122 |  char *unsupported_term[] = {"dumb","cons25","emacs",NULL};
      |                                              ^~~~~~~

../thirdparty/linenoise/linenoise.c:908:27: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  908 | char *linenoiseEditMore = "If you see this, you are misusing the API: when linenoiseEditFeed() is called, if it returns linenoiseEditMore the user is yet editing the line. See the README file for more information.";
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1. unsupporeted_term should be const char*
2. linenoiseEditMore should be const char*, but linenoiseEditFeed()
   return char *, so add a local heap-allocate variable.

Signed-off-by: Meinhard Zhou <zhouenhua@bytedance.com>
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.

1 participant