This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Strange (worrysome?) g++ problem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]