[comp.sources.bugs] Problem with TRN 1.0.2 patch

DOUG@ysub.ysu.edu (Doug Sewell) (01/23/91)

When 'make' hits the line 'cc -c -O -I. mthreads.c', it gets:
>"./mthreads.h", line 61: syntax error

(ignore the -I., its for a workaround due to some missing routines)

Line 61 of mthreads.h is:
>void dont_read_data(int);

The call to dont_read_data() in mthreads.c is:
>dont_read_data( data_file_open );

data_file_open is defined as a char earlier in mthreads.c.

In mt_read.c, the parameter for dont_read_data is defined to be an int.

I'm not sure what to change, since C isn't my 'strong' language.  Any
suggestions ?  Has this happened to anyone else ?


Our environment:
   NCR Tower 700, System V
   C-News
   Trn 1.0.2 (patch just applied)
   A couple of missing routines mthreads needs borrowed from C-news.

Thanks in advance, Doug
--
Doug Sewell, Tech Support, Computer Center,         doug@ysub.bitnet
Youngstown State University, Youngstown,  OH 44555  doug@ysub.ysu.edu
Go to jail. Go directly to jail. Do not pass GO. Do not collect $200.

tale@rpi.edu (David C Lawrence) (01/23/91)

All you have to do is wrap the "(int)" with the ANSI() macro at line
61 in mthreads.h.  An apparent oversight by someone using an ANSI
compiler. 
--
   (setq mail '("tale@cs.rpi.edu" "tale@ai.mit.edu" "tale@rpitsmts.bitnet"))

gwyn@smoke.brl.mil (Doug Gwyn) (01/24/91)

In article <91022.140110DOUG@ysub.ysu.edu> DOUG@ysub.ysu.edu (Doug Sewell) writes:
>When 'make' hits the line 'cc -c -O -I. mthreads.c', it gets:
>>"./mthreads.h", line 61: syntax error
>Line 61 of mthreads.h is:
>>void dont_read_data(int);
>The call to dont_read_data() in mthreads.c is:
>>dont_read_data( data_file_open );
>data_file_open is defined as a char earlier in mthreads.c.
>In mt_read.c, the parameter for dont_read_data is defined to be an int.
>I'm not sure what to change, ...

There is no need to be concerned over the apparently-char argument in
the function call, since it is promoted to int.

My guess is that your compiler does not support prototypes, and thus
the appropriate declaration in mthreads.h should have been
	void dont_read_data();
Without looking at the code I have no idea why prototypes were being
used.

tony@mwuk.UUCP (Tony Mountifield) (01/24/91)

In article <14946@smoke.brl.mil> gwyn@smoke.brl.mil (Doug Gwyn) writes:
> In article <91022.140110DOUG@ysub.ysu.edu> DOUG@ysub.ysu.edu (Doug Sewell) writes:
> >When 'make' hits the line 'cc -c -O -I. mthreads.c', it gets:
> >>"./mthreads.h", line 61: syntax error
> >Line 61 of mthreads.h is:
> >>void dont_read_data(int);
[............]
> My guess is that your compiler does not support prototypes, and thus
> the appropriate declaration in mthreads.h should have been
> 	void dont_read_data();
> Without looking at the code I have no idea why prototypes were being
> used.

I had the same problem, and it is due to an oversight in the declaration.
It shoudl have read:

	void dont_read_data ANSI((int))

ANSI is a macro which either includes or omits the prototypes (compare
the other declarations around the same area).
-- 
Tony Mountifield.                | Microware Systems (UK) Ltd.
MAIL:  tony@mwuk.uucp            | Leylands Farm, Nobs Crook,
INET:  tony%mwuk.uucp@ukc.ac.uk  | Colden Common, WINCHESTER, SO21 1TH.
UUCP:  ...!mcsun!ukc!mwuk!tony   | Tel: 0703 601990   Fax: 0703 601991
**** OS-9, OS-9000 Real Time Systems **** MS-DOS - just say "No!" ****