Hi Fred,
I have problems when compiling your source file.
I tried compiling-it on a RC2014.
The results:
-------------------------
(using the original HiTech C)
c -v -c credir.c
HI-TECH C COMPILER (CP/M-80) V3.09
Copyright (C) 1984-87 HI-TECH SOFTWARE
0:CPP -DCPM -DHI_TECH_C -Dz80 -I CREDIR.C $CTMP1.$$$
0:P1 $CTMP1.$$$ $CTMP2.$$$ $CTMP3.$$$
sys.h:
24: extern int getuid(void);
getuid: type redeclared ^
25: extern int setuid(int);
setuid: type redeclared ^
CREDIR.C: disp2()
91: int un, defined, dir;
^ un: storage class redeclared
^ defined: storage class redeclared
^ dir: storage class redeclared
^ identifier redefined: dir
94: un = bdos(32, 0xff);
^ only lvalues may be assigned to or modified
^ illegal conversion
96: defined = 0;
^ not a variable identifier: defined
^ only lvalues may be assigned to or modified
^ illegal conversion
98: for (dir = 0; dir < 64; ++dir)
^ undefined identifier: dir
99: if ((dirdisk[dir] == disk) && (dirun[dir] == un)) {
type conflict ^
simple type required for == ^
101: defined = 1;
^ not a variable identifier: defined
^ only lvalues may be assigned to or modified
^ illegal conversion
103: if (defined == 0)
^ not a variable identifier: defined
^ illegal use of void expression
106: }
^ unused member: dir (warning)
CREDIR.C: cdir()
164: int dir, index;
^ index: storage class redeclared
^ identifier redefined: index
167: index = -1;
^ not a variable identifier: index
^ only lvalues may be assigned to or modified
^ illegal conversion
170: index = dir;
^ not a variable identifier: index
^ only lvalues may be assigned to or modified
^ illegal conversion
171: if (index == -1) {
^ not a variable identifier: index
^ illegal use of void expression
176: if (dirun[index] >= 15)
^ not a variable identifier: index
^ illegal type for index expression
type conflict ^
178: udflag = dirun[index] << 4;
^ not a variable identifier: index
^ illegal type for index expression
type conflict ^
179: udflag |= dirdisk[index] - 'A';
^ not a variable identifier: index
^ illegal type for index expression
type conflict ^
181: setuid(dirun[index]);
^ not a variable identifier: index
^ illegal type for index expression
type conflict ^
CREDIR.C: writepgm()
320: unsigned u;
^ u: storage class redeclared
^ identifier redefined: u
324: fd = open(fname, O_RDWR);
^ undefined identifier: O_RDWR
329: u = (unsigned)&cend - (unsigned)spass;
^ only lvalues may be assigned to or modified
illegal conversion ^
330: lseek(fd, (long)spass - (long)0x100, SEEK_SET);
undefined identifier: SEEK_SET ^
331: write(fd, (void *)spass, u);
illegal conversion ^
334: }
^ unused variable definition: ÜÞï#ª>Ïc"Ç;»Æà(ª¢è:+\
ö< ?
ï?p?í (warning)
CREDIR.C: readpgm()
339: fd = open("0:A:CREDIR.COM", O_RDWR);
^ undefined identifier: O_RDWR
342: u = (unsigned)&cend - (unsigned)directory;
^ undefined identifier: u
illegal conversion ^
343: lseek(fd, (long)directory - (long)0x100, SEEK_SET);
illegal conversion ^
not a variable identifier: SEEK_SET ^
illegal conversion ^
344: read(fd, (void *)directory, u);
^ : storage class redeclared
illegal conversion ^
(********************************** here, P1 crashes... rebooting...then replacing P1 with 'my' P1...)
Small Computer Monitor - S3
*cpm
RC2014 CP/M BIOS 1.2 by G. Searle 2007-18
CP/M 2.2 Copyright 1979 (c) by Digital Research
d:
pip p1.com=newp1.com
c -v -c credir.c
HI-TECH C COMPILER (CP/M-80) V3.09
Copyright (C) 1984-87 HI-TECH SOFTWARE
0:CPP -DCPM -DHI_TECH_C -Dz80 -I CREDIR.C $CTMP1.$$$
0:P1 $CTMP1.$$$ $CTMP2.$$$ $CTMP3.$$$
sys.h:
24: extern int getuid(void);
getuid: type redeclared ^
25: extern int setuid(int);
setuid: type redeclared ^
CREDIR.C: writepgm()
324: fd = open(fname, O_RDWR);
^ Error #72 O_RDWR
330: lseek(fd, (long)spass - (long)0x100, SEEK_SET);
Error #72 SEEK_SET ^
CREDIR.C: readpgm()
339: fd = open("0:A:CREDIR.COM", O_RDWR);
Error #72 O_RDWR ^
343: lseek(fd, (long)directory - (long)0x100, SEEK_SET);
Error #72 SEEK_SET ^
ERA $CTMP1.$$$
ERA $CTMP2.$$$
ERA $CTMP3.$$$
ERA $$EXEC.$$$
grep *.h
please enter the string to be searched, followed by a <CR>:getuid
CPM.H
SYS.H
grep *.h
please enter the string to be searched, followed by a <CR>:O_RDWR
grep *.h
please enter the string to be searched, followed by a <CR>:SEEK_SET
----------------------
So, it seems there is a conflict between CPM.H and SYS.H (both contain a (different) prototype of getuid ...), and I cannot find any .H containing the definitions of O_RDWR and SEEK_SET.
Ladislau
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)