Subject: Re: Compiling apout pdp-11 simulator
To: None <tmiller@flex.com>
From: Masao Uebayashi <uebayasi@pultek.co.jp>
List: current-users
Date: 06/30/2003 12:52:55
Hello.

> aluminum: {2} make
> gcc -DNATIVES -DINLINE=inline -O3 -Winline -Wall  -finline-functions 
> -fomit-frame-pointer  -c bsd_signal.c
> bsd_signal.c:57: warning: no semicolon at end of struct or union
> bsd_signal.c:57: parse error before `.'
> bsd_signal.c:60: parse error before `}'
> bsd_signal.c: In function `set_bsdsig_dfl':
> bsd_signal.c:91: invalid use of undefined type `struct bsd_sigaction'
> bsd_signal.c:92: invalid use of undefined type `struct bsd_sigaction'
> bsd_signal.c:92: invalid use of undefined type `struct bsd_sigaction'
> bsd_signal.c: In function `do_sigaction':
> bsd_signal.c:106: invalid use of undefined type `struct bsd_sigaction'
> bsd_signal.c:106: sizeof applied to an incomplete type
> bsd_signal.c:116: dereferencing pointer to incomplete type
> bsd_signal.c:120: dereferencing pointer to incomplete type
> bsd_signal.c:129: invalid use of undefined type `struct bsd_sigaction'
> bsd_signal.c:129: sizeof applied to an incomplete type
> bsd_signal.c: At top level:
> bsd_signal.c:81: storage size of `Sigact' isn't known
> *** Error code 1
> 
> Stop.

`sa_handler' is a macro defined in sys/signal.h as

	#define sa_handler _sa_u._sa_handler

so you should avoid the name in local code.

This can work-around the comilation error here.  Not tested further.

Masao

--- bsd_signal.c.orig	Mon Jan 10 14:12:26 2000
+++ bsd_signal.c	Mon Jun 30 12:48:00 2003
@@ -53,7 +53,7 @@
  * Signal vector "template" used in sigaction call.
  */
 struct	bsd_sigaction {
-	int16_t	sa_handler;		/* signal handler */
+	int16_t	_sa_handler;		/* signal handler */
 	u_int32_t sa_mask;		/* signal mask to apply */
 	int16_t	sa_flags;		/* see signal options below */
 };
@@ -87,7 +87,7 @@
 
   for (i=0;i<NBSDSIG;i++) {
 	if (bsdsig[i]) signal(bsdsig[i], SIG_DFL);
-	Sigact[i].sa_handler= BSDSIG_DFL;
+	Sigact[i]._sa_handler= BSDSIG_DFL;
 	Sigact[i].sa_mask= Sigact[i].sa_flags= 0;
   }
 }