Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

m . c: In function execArgsPiped : m . c: 1 0 1 : 1 8 : warning: passing argument 1 of execvp makes pointer

m.c: In function execArgsPiped:
m.c:101:18: warning: passing argument 1 of execvp makes pointer from integer without a cast [-Wint-conversion]
101| if (execvp(parsed[0], parsed)<0){
| ~~~~~~^~~
||
| char
In file included from m.c:4:
/usr/include/unistd.h:578:32: note: expected const char * but argument is of type char
578| extern int execvp (const char *__file, char *const __argv[])
| ~~~~~~~~~~~~^~~~~~
m.c:101:23: warning: passing argument 2 of execvp from incompatible pointer type [-Wincompatible-pointer-types]
101| if (execvp(parsed[0], parsed)<0){
|^~~~~~
||
| char *
In file included from m.c:4:
/usr/include/unistd.h:578:52: note: expected char * const* but argument is of type char *
578| extern int execvp (const char *__file, char *const __argv[])
| ~~~~~~~~~~~~^~~~~~~~
m.c:120:22: warning: passing argument 1 of execvp makes pointer from integer without a cast [-Wint-conversion]
120| if (execvp(parsedpipe[0], parsedpipe)<0){
| ~~~~~~~~~~^~~
||
| char
In file included from m.c:4:
/usr/include/unistd.h:578:32: note: expected const char * but argument is of type char
578| extern int execvp (const char *__file, char *const __argv[])
| ~~~~~~~~~~~~^~~~~~
m.c:120:27: warning: passing argument 2 of execvp from incompatible pointer type [-Wincompatible-pointer-types]
120| if (execvp(parsedpipe[0], parsedpipe)<0){
|^~~~~~~~~~
||
| char *
In file included from m.c:4:
/usr/include/unistd.h:578:52: note: expected char * const* but argument is of type char *
578| extern int execvp (const char *__file, char *const __argv[])
| ~~~~~~~~~~~~^~~~~~~~
m.c: In function parsePipe:
m.c:197:22: warning: passing argument 1 of strsep from incompatible pointer type [-Wincompatible-pointer-types]
197| strpiped[i]= strsep(&str,"|");
|^~~~
||
| char *
In file included from m.c:2:
/usr/include/string.h:440:14: note: expected char ** restrict but argument is of type char *
440| extern char *strsep (char **__restrict __stringp,
|^~~~~~
m.c:197:13: warning: assignment to char from char * makes integer from pointer without a cast [-Wint-conversion]
197| strpiped[i]= strsep(&str,"|");
|^
m.c:198:17: warning: comparison between pointer and integer
198| if (strpiped[i]== NULL)
|^~
m.c:202:17: warning: comparison between pointer and integer
202| if (strpiped[1]== NULL)
|^~
m.c: In function parseSpace:
m.c:215:20: warning: passing argument 1 of strsep from incompatible pointer type [-Wincompatible-pointer-types]
215| parsed[i]= strsep(&str,"");
|^~~~
||
| char *
In file included from m.c:2:
/usr/include/string.h:440:14: note: expected char ** restrict but argument is of type char *
440| extern char *strsep (char **__restrict __stringp,
|^~~~~~
m.c:215:11: warning: assignment to char from char * makes integer from pointer without a cast [-Wint-conversion]
215| parsed[i]= strsep(&str,"");
|^
m.c:217:15: warning: comparison between pointer and integer
217| if (parsed[i]== NULL)
|^~
m.c:219:18: warning: passing argument 1 of strlen makes pointer from integer without a cast [-Wint-conversion]
219| if (strlen(parsed[i])==0)
| ~~~~~~^~~
||
| char
In file included from m.c:2:
/usr/include/string.h:385:35: note: expected const char * but argument is of type char
385| extern size_t strlen (const char *__s)
| ~~~~~~~~~~~~^~~
m.c: In function processString:
m.c:230:24: warning: passing argument 2 of parsePipe from incompatible pointer type [-Wincompatible-pointer-types]
230| piped = parsePipe(str, strpiped);
|^~~~~~~~
||
| char **
m.c:193:31: note: expected char * but argument is of type char **
193| int parsePipe(char str, char* strpiped)
| ~~~~~~^~~~~~~~
m.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions