Created
November 10, 2011 08:33
-
-
Save lalala/1354430 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
. | |
. | |
char *printenv[] = { "printenv", NULL }; | |
char *sort[] = { "sort", NULL }; | |
char *less[] = { "less", NULL }; | |
unsigned int *pro[3] = { &printenv, &sort, &less }; | |
. | |
. | |
. | |
# | |
# Gives this warning | |
# | |
gcc -Wall -ansi -g -o digenv digenv.c | |
digenv.c: In function ‘main’: | |
digenv.c:15:3: warning: initialization from incompatible pointer type [enabled by default] | |
digenv.c:15:3: warning: (near initialization for ‘pro[0]’) [enabled by default] | |
digenv.c:15:3: warning: initialization from incompatible pointer type [enabled by default] | |
digenv.c:15:3: warning: (near initialization for ‘pro[1]’) [enabled by default] | |
digenv.c:15:3: warning: initialization from incompatible pointer type [enabled by default] | |
digenv.c:15:3: warning: (near initialization for ‘pro[2]’) [enabled by default] | |
digenv.c:45:7: error: incompatible type for argument 1 of ‘execvp’ | |
/usr/include/unistd.h:575:12: note: expected ‘const char *’ but argument is of type ‘float’ | |
digenv.c:45:7: warning: passing argument 2 of ‘execvp’ from incompatible pointer type [enabled by default] | |
/usr/include/unistd.h:575:12: note: expected ‘char * const*’ but argument is of type ‘float *’ | |
digenv.c:63:5: warning: implicit declaration of function ‘wait’ [-Wimplicit-function-declaration] | |
make: *** [digenv] Error 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment