Ensure that src variable type to test mbsrtowcs is correct (#2735)

When compiling with -Werror (./configure CFLAGS="-Werror" ...),
the test to see if mbsrtowcs exists
failed with pointer type of incompatible type, is char **, should be
const char **. It would proceed to assume mbsrtowcs didn't exist.
This commit is contained in:
Paulo Matos 2019-07-11 12:20:36 +02:00 committed by GitHub
parent 85f4fc1337
commit e6922e76ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -4256,7 +4256,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#include <strings.h>
int main() {
mbstate_t state;
char *src = "X";
const char *src = "X";
bzero(&state, sizeof(mbstate_t));
mbsrtowcs(0, &src, 0, &state);
return 0;

View File

@ -217,7 +217,7 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([
#include <strings.h>
int main() {
mbstate_t state;
char *src = "X";
const char *src = "X";
bzero(&state, sizeof(mbstate_t));
mbsrtowcs(0, &src, 0, &state);
return 0;