This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

getopt with gcc -ansi


I compiled the following test.c on Redhat 9.

#include <unistd.h>

int main(int argc, char **argv){
  getopt(argc, argv, "a");
  return 0;
}

$ gcc -Wall test.c
$ gcc -Wall -ansi test.c
test_getopt.c: In function `main':
test_getopt.c:4: warning: implicit declaration of function `getopt'

Why the declaration of getopt is not effective when I compile with
-ansi?  Could I use getopt with -ansi?

susukita


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]