What does my compiler error mean?

My program compiles with cc but when I compile it with $ gcc -pedantic -Wall -ansi -O4 I get warnings that I don’t understand:

miniShell.c: In function ‘main’:
miniShell.c:144:24: warning: initializer element is not computable at load time [enabled by default]
                 struct command cmd[] = { {printenv}, {sort}, {less} };

What does the above mean? I have my declarations on the top of main for these variables:

        char *printenv[] = { "printenv", 0};
        char *sort[] = { "sort", 0 };
        char *less[] = { "less", 0 };
        struct command cmd[] = { {printenv}, {sort}, {less} };

I have a global variable for command.

struct command
    char * const *argv;

Source: gcc

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.