[Bug c++/50423] error: ‘getpid’ was not declared in this scope

2011-09-16 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50423

--- Comment #4 from Jonathan Wakely redi at gcc dot gnu.org 2011-09-16 
09:34:31 UTC ---
As documented at http://gcc.gnu.org/gcc-4.7/changes.html

Avoid polluting the global namespace by inclusion of unistd.h.


[Bug c++/50423] error: ‘getpid’ was not declared in this scope

2011-09-15 Thread howarth at nitro dot med.uc.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50423

--- Comment #1 from Jack Howarth howarth at nitro dot med.uc.edu 2011-09-15 
17:57:08 UTC ---
Attached bzip2 compressed preprocessed source for common/semaphore.cc
reproduces this issue...

[MacPro:~/xplor-nih-2.27/common/bin.Darwin_11_x86_64] howarth% g++-fsf-4.7 -c
semaphore.ii -O3 -ffast-math -funroll-loops -g -fpermissive -DX_MMAP_FLAGS=0
-DFORTRAN_INIT -fno-common -DDARWIN -D_REENTRANT -DNDEBUGsemaphore.cc: In
constructor ‘CDS::Semaphore::Semaphore(bool)’:semaphore.cc:111:30: error:
‘getpid’ was not declared in this scope
semaphore.cc: In destructor ‘CDS::Semaphore::~Semaphore()’:
semaphore.cc:124:36: error: ‘getpid’ was not declared in this scope
semaphore.cc:126:9: warning: deleting ‘void*’ is undefined [enabled by default]


[Bug c++/50423] error: ‘getpid’ was not declared in this scope

2011-09-15 Thread howarth at nitro dot med.uc.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50423

--- Comment #2 from Jack Howarth howarth at nitro dot med.uc.edu 2011-09-15 
17:57:45 UTC ---
Note that -fpermissive doesn't eliminate the regression.


[Bug c++/50423] error: ‘getpid’ was not declared in this scope

2011-09-15 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50423

Andrew Pinski pinskia at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID

--- Comment #3 from Andrew Pinski pinskia at gcc dot gnu.org 2011-09-15 
18:01:34 UTC ---
This is expected you are not including unistd.h in your source which is
required if you want to use getpid.  It was a bug before GCC 4.7 that some of
the C++ headers included that header file.