Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* need workaround for OSF/1 cc gagging on "union wait status"
@ 1994-08-15 20:36 Paul Southworth
  1994-08-16  8:04 ` Burkhard Neidecker-Lutz
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Southworth @ 1994-08-15 20:36 UTC (permalink / raw)



I seem to be bitten by this {feature|bug|strictly-enforced-standard|whatever}
fairly frequently and I would like to know what the workaround is.  This 
code snippet is from the BSD rlogin code, for example, and I see this syntax
elsewhere as well.  Please send email if you know an easy workaround for
it.

catch_child()
{
        union wait status;
        int pid;

        for (;;) {
                pid = wait3((int *)&status,
                    WNOHANG|WUNTRACED, (struct rusage *)0);
                if (pid == 0)
                        return;
                /* if the child (reader) dies, just quit */
                if (pid < 0 || pid == child && !WIFSTOPPED(status))
                        done((int)(status.w_termsig | status.w_retcode));
        }
        /* NOTREACHED */
}

That results in the following:

% cc -c rlogin.c
/usr/lib/cmplrs/cc/cfe: Error: rlogin.c, line 328: storage size for 'status' isn't known
        union wait status;
        -----------^
/usr/lib/cmplrs/cc/cfe: Error: rlogin.c, line 328: Reference an expression of void type or an incomplete type.
        union wait status;
        -----------^
/usr/lib/cmplrs/cc/cfe: Error: rlogin.c, line 337: Reference an expression of void type or an incomplete type.
                if (pid < 0 || pid == child && !( (((status) & 0177     ) == 0177       ) && !(((status) & 0377) == 0377) ))
                -------------------------------------^

--
Paul Southworth
CICNet Systems Support
pauls@cic.net


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: need workaround for OSF/1 cc gagging on "union wait status"
  1994-08-15 20:36 need workaround for OSF/1 cc gagging on "union wait status" Paul Southworth
@ 1994-08-16  8:04 ` Burkhard Neidecker-Lutz
  0 siblings, 0 replies; 2+ messages in thread
From: Burkhard Neidecker-Lutz @ 1994-08-16  8:04 UTC (permalink / raw)


In article <32ojkv$gbe@spruce.cic.net> pauls@locust.cic.net (Paul Southworth) writes:
>
>I seem to be bitten by this {feature|bug|strictly-enforced-standard|whatever}
>fairly frequently and I would like to know what the workaround is.  This 
>        union wait status;

It's a POSIXism. Either do:

	cc -D_BSD rlogin.c

or change the source to use the POSIX form:

	int status;

		Burkhard Neidecker-Lutz

GLASS Project, CEC Karlsruhe 
Advanced Technology Group, Digital Equipment Corporation
neideck@nestvx.enet.dec.com

"July 94: DEC 3000/900, SPECint 189.3, SPECfp 264.1, 275 Mhz 21064A"


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1994-08-16  8:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-08-15 20:36 need workaround for OSF/1 cc gagging on "union wait status" Paul Southworth
1994-08-16  8:04 ` Burkhard Neidecker-Lutz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox