[comp.unix.xenix.sco] C-News ?

sginn@hlthnt.UUCP (Steve Ginn) (04/29/91)

I am still very new at programming and have run across the following 
problem when trying to compile (using doit.bin) C-News under Xenix 2.3.1

I get the following errors and the associated file (I believe) 
follows as well.

If anyone has any ideas to help out a novice I would appreciate it.

Thanks,
Steve Ginn


P.S.  If anyone by chance happens to have successfully compiled
C-News under Xenix 2.3.1 - 2.3.3, I would appreciate any suggestions
concerning its setup, since the Docs have very little specific
information for Xenix owners.  Also, I would appreciate hearing
anything concerning C-News from Xenix owners, either Pro or Con.


The following is the beginning of the error messages I received
upon running "doit.bin"


+make u COPTS=-O
	cc -O -I../include -c warning.c

warning.c
warning.c (30): error C2143: syntax error: missing ')' before ';'
warning.c (30): error C2143: syntax error: missing ';' before ';'

*** Error code 2

Stop.
+exit 1


The following is excerpt from "warning.c" with appropriate line No.'s:


24	if (cmdname != NULL && *cmdname != '\0')
25		fprintf(stderr, "%s:", cmdname);	/* No space after :. */
26	if (progname != NULL)
27		fprintf(stderr, "%s: ", progname);
28	fprintf(stderr, s1, s2);
29	if (saverrno != 0)
30		fprintf(stderr, "(%s)", strerror(saverrno));
31	fprintf(stderr, "\n");
32	(void) fflush(stderr);
33	errno = 0;
34 }


I know this is probably too easy for most, but as I said, I am just 
trying to learn!  Thanks!


Steve Ginn                              7309 Parkland Dr.
Health-Net Systems, Inc.		El Paso, Texas  79925
UUCP:  unmvax!bbx!hlthnt!sginna         (915) 779-6245
INTERNET:  sginn%hlthnt@bbx.basis.com

ronald@robobar.co.uk (Ronald S H Khoo) (04/30/91)

sginn@hlthnt.UUCP (Steve Ginn) writes:

> warning.c (30): error C2143: syntax error: missing ')' before ';'
> warning.c (30): error C2143: syntax error: missing ';' before ';'
> 
> 30		fprintf(stderr, "(%s)", strerror(saverrno));

SCO broke string.h by #define'ing strerror in /usr/include/string.h
You can't do it like that.

To fix: edit /usr/include/string.h and delete the line which says
#define	strerror(error) /* whatever */
up until the end of the definition.

Then rerun "build" and make sure you tell it that you *don't* have
strerror.  The strerror() implementation in libfake/ is good enough
for most normal uses.

-- 
Ronald Khoo <ronald@robobar.co.uk> +44 81 991 1142 (O) +44 71 229 7741 (H)

timk@wynnds.xenitec.on.ca (Tim Kuehn) (05/01/91)

In article <41@hlthnt.UUCP> sginn@hlthnt.UUCP (Steve Ginn) writes:
>I am still very new at programming and have run across the following 
>problem when trying to compile (using doit.bin) C-News under Xenix 2.3.1
>
>I get the following errors and the associated file (I believe) 
>follows as well.
>
>P.S.  If anyone by chance happens to have successfully compiled
>C-News under Xenix 2.3.1 - 2.3.3, I would appreciate any suggestions
>concerning its setup, since the Docs have very little specific
>information for Xenix owners.  

I have Cnews running under Xenix 2.3.3 here, and love it to pieces. 

>Also, I would appreciate hearing anything concerning C-News from 
>Xenix owners, either Pro or Con.

There's not enough I can say Pro Cnews, and very little con, except 
for some of the install notes could be clearer. HOWEVER - for a SW pkg
that's as system independant as Cnews is, that's no big deal. You just
need to know what you're doing (or find someone who does :-))

>The following is the beginning of the error messages I received
>upon running "doit.bin"

>+make u COPTS=-O
>	cc -O -I../include -c warning.c
>warning.c (30): error C2143: syntax error: missing ';' before ';'
>*** Error code 2

[source code line:]
>30		fprintf(stderr, "(%s)", strerror(saverrno));

The reason for this is a rather bizzarre macro for strerror() in 
/usr/include/string.h which looks like:

#define strerror(err)	( sys_errlist[err] );
				       	    ^
It's this ";" that your compiler's hitting. Easiest fix? Tell "build" you 
don't have strerror. 

>I know this is probably too easy for most, but as I said, I am just 
>trying to learn!  Thanks!

If you (or any other xenix'ers out there) need the files created by 
build (doit.root, doit.bin, doit.news, again.root), email me. If there's
enough requests I'll post them to the net. (It's only ~15K all told)

WARNING! There is a bug in the compiler when doing the "dbz" libararies, 
which you have to take out of the doit.bin file. Do NOT compile the 
dbz stuff with optimization on (COPTS=-O). Remove references to 
"COPTS=-O" (replace it with "COPTS=") when building the dbz progs. 
Otherwise you'll run into trouble! (This will require manual editing of
the doit.bin file each time you create it.)

   ------------------------------------------------------------------------ 
   Tim Kuehn			    TDK Consulting Services  (519)-888-0766
   timk@wynnds.xenitec.on.ca  -or-  !{watmath|lsuc}!xenitec!wynnds!timk
   Valpo EE turned loose on unsuspecting world! News at 11!

phil@ls.com (Phil Eschallier) (05/01/91)

In article <1991Apr30.101218.10473@robobar.co.uk> ronald@robobar.co.uk (Ronald S H Khoo) writes:
>sginn@hlthnt.UUCP (Steve Ginn) writes:
>SCO broke string.h by #define'ing strerror in /usr/include/string.h
>You can't do it like that.
>
>To fix: edit /usr/include/string.h and delete the line which says
>#define	strerror(error) /* whatever */
>up until the end of the definition.
>

	not necessary -- the only change needed is to delete the
	trailing semi-colon on the define ... this will fix your
	problem while still using sco conventions ...

	phil

-- 
Phil Eschallier     |  E-Mail to:                    US Mail to:
                    |   INET: phil@ls.com             248B Union Street
Lagniappe Systems   |   UUCP: ...!uunet!lgnp1!phil    Doylestown, PA  18901
Computer Services   |    CIS: 71076,1576              VOICE: +1 215 348 9721