Skip to content

Instantly share code, notes, and snippets.

/warnings.diff Secret

Created September 4, 2013 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3d8536e736289963d15f to your computer and use it in GitHub Desktop.
Save anonymous/3d8536e736289963d15f to your computer and use it in GitHub Desktop.
diff --git a/src/io/procops.c b/src/io/procops.c
index 25b4950..823c5a3 100644
--- a/src/io/procops.c
+++ b/src/io/procops.c
@@ -124,7 +124,7 @@ MVMint64 MVM_proc_spawn(MVMThreadContext *tc, MVMString *cmd, MVMString *cwd, MV
#else
char sh[] = "/bin/sh";
args[0] = sh;
- args[1] = "-c";
+ args[1] = (char *)"-c";
args[2] = cmdin;
args[3] = NULL;
#endif
@@ -150,7 +150,7 @@ MVMint64 MVM_proc_spawn(MVMThreadContext *tc, MVMString *cmd, MVMString *cwd, MV
free(cmdin);
i = 0;
while(_env[i])
- free(_env[i++]);
+ free((void *)_env[i++]);
free(_env);
@FROGGS
Copy link

FROGGS commented Sep 4, 2013

LC_ALL=C make
compiling src/io/procops.o
src/io/procops.c: In function 'MVM_proc_spawn':
src/io/procops.c:153:9: warning: passing argument 1 of 'free' discards 'const' qualifier from pointer target type [enabled by default]
In file included from src/moarvm.h:1:0,
                 from src/io/procops.c:1:
/usr/include/stdlib.h:482:13: note: expected 'void *' but argument is of type 'const char *'
linking libmoarvm.a
linking moarvm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment