public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/3287: usleep() undeclared
@ 2001-06-20 15:05 aoliva
0 siblings, 0 replies; 2+ messages in thread
From: aoliva @ 2001-06-20 15:05 UTC (permalink / raw)
To: f.bettoni, gcc-bugs, gcc-prs, nobody
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* c++/3287: usleep() undeclared
@ 2001-06-20 4:16 f.bettoni
0 siblings, 0 replies; 2+ messages in thread
From: f.bettoni @ 2001-06-20 4:16 UTC (permalink / raw)
To: gcc-gnats
>Number: 3287
>Category: c++
>Synopsis: usleep() undeclared
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jun 20 04:16:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: f.bettoni@saritel.it
>Release: gcc3.0
>Organization:
>Environment:
Digital UNIX 4.0d
>Description:
The following code doesn't compile with g++ usleep.cc
#include <unistd.h>
int main (int ac, char **av)
{ usleep (10); }
usleep.cc: In function `int main(int, char**)':
usleep.cc:3: `usleep' undeclared (first use this function)
usleep.cc:5: (Each undeclared identifier is reported only once for each
/usr/local/lib/gcc-lib/alpha-dec-osf4.0d/3.0/include/unistd.h is used preprocessing and usleep() is not defined inside
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-06-20 15:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-20 15:05 c++/3287: usleep() undeclared aoliva
-- strict thread matches above, loose matches on Subject: below --
2001-06-20 4:16 f.bettoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).