This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/3287: usleep() undeclared
- To: f dot bettoni at saritel dot it, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Subject: Re: c++/3287: usleep() undeclared
- From: aoliva at gcc dot gnu dot org
- Date: 20 Jun 2001 22:05:36 -0000
Synopsis: usleep() undeclared
State-Changed-From-To: open->closed
State-Changed-By: aoliva
State-Changed-When: Wed Jun 20 15:05:36 2001
State-Changed-Why:
The problem is that unistd.h doesn't always declare usleep(), and C++ requires every called function to have been previously declared. It seems to me that to get the appropriate declaration, you have to use -D_POSIX_SOURCE or -D_XOPEN_SOURCE_EXTENDED. g++ won't reject the code because of the lack of a declaration if you use -fpermissive.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3287&database=gcc