This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
getopt with gcc -ansi
- From: Susukita Ryutaro <susukita at postman dot riken dot go dot jp>
- To: libc-alpha at sources dot redhat dot com
- Cc: susukita at postman dot riken dot go dot jp
- Date: Wed, 11 Aug 2004 12:42:08 +0900
- Subject: 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