This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
971105 strange g++ pb (still)
- To: egcs at cygnus dot com
- Subject: 971105 strange g++ pb (still)
- From: Neal Becker <neal at ctd dot comsat dot com>
- Date: Fri, 7 Nov 1997 08:46:26 -0500
This strange problem is still present in 971105 g++. (BTW, this is
found by trying to build kde on linux/glibc2.0.5).
The strange code below is the expansion of WIFEXITED on glibc205.
Here's what happens:
g++ -c Test.cc
Test.cc: In method `bool KProcess::normalExit()':
Test.cc:15: member `status' is a private member of class `KProcess'
Well, that's all nonsense. We're trying to access 'status' from a
member function of KProcess. So what's this complaint that it's
private?
#include <sys/types.h>
class KProcess {
private:
pid_t pid;
int status;
bool runs;
public:
bool normalExit();
};
bool KProcess::normalExit()
{
return (pid != 0) && (!runs) && (((( (__extension__ ({ union { __typeof( status ) __in; int __i; } __u; __u.__in = ( status ); __u.__i; })) ) & 0x7f) == 0) );
}