public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Strange (worrysome?) g++ problem
@ 1997-11-01  8:46 neal
  0 siblings, 0 replies; only message in thread
From: neal @ 1997-11-01  8:46 UTC (permalink / raw)
  To: egcs

[-- Attachment #1: Type: text/plain, Size: 823 bytes --]

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


[-- Attachment #2: Test.ii.gz --]
[-- Type: application/x-gzip, Size: 2768 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1997-11-01  8:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-01  8:46 Strange (worrysome?) g++ problem neal

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).