This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Strange (worrysome?) g++ problem
- To: egcs at cygnus dot com
- Subject: Strange (worrysome?) g++ problem
- From: <neal at ctd dot comsat dot com>
- Date: Sat, 1 Nov 1997 11:45:39 -0500
Here is an very small test case that produces a very strange result.
This is egcs-971031 linux-i586 glibc-2.0.5.
Here is Test.cc:
--------------------
#include <sys/types.h> // for pid_t
#include <sys/wait.h>
#include <signal.h>
class KProcess {
private:
pid_t pid;
int status; // the process' exit status as returned by "waitpid"
bool runs; // the process is currently executing
public:
bool normalExit();
};
bool KProcess::normalExit()
{
return (pid != 0) && (!runs) && (WIFEXITED(status));
}
-------------------
Here's what happens:
g++ -c Test.cc
Test.cc: In method `bool KProcess::normalExit()':
Test.cc:17: member `status' is a private member of class `KProcess'
--------------------------
Now you will probably want to see Test.ii because the expansion of
WIFEXITED is rather odd
Test.ii.gz