Date: Tue, 14 May 1996 14:46:47 -0500 From: Randy Terbush <randy@zyzzyva.com> To: perl5-ports@nicoh.com, marc@iss.mach.uni-karlsruhe.de, hackers@freebsd.org Subject: doio.c fails to compile with pgcc on FreeBSD Message-ID: <199605141946.OAA04778@sierra.zyzzyva.com>
next in thread | raw e-mail | index | archive | help
I'm sending this report to both camps since it is not clear to me why this fails. Please CC me your discussion. The following bit of code from doio.c fails to compile with the following error message using the pgcc (pentium compiler) on FreeBSD-stable. pgcc is 960426 snapshot. doio.c: In function `Perl_do_ipcctl': doio.c:1364: incompatible type for argument 4 of `semctl' doio.c:1410: incompatible type for argument 4 of `semctl' *** Error code 1 =========== man semctl =========== int semctl(int semid, int semnum, int cmd, union semun arg) DESCRIPTION Semctl() performs the operation indicated by cmd on the semaphore set in- dicated by semid. For the commands that use the arg parameter, union semun is defined as follows: union semun { int val; /* value for SETVAL */ struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */ u_short *array; /* array for GETALL & SETALL */ }; struct semid_ds { struct ipc_perm sem_perm; /* operation permission struct */ struct sem *sem_base; /* pointer to first semaphore in set */ u_short sem_nsems; /* number of sems in set */ time_t sem_otime; /* last operation time */ long sem_pad1; /* SVABI/386 says I need this here */ time_t sem_ctime; /* last change time */ /* Times measured in secs since */ /* 00:00:00 GMT, Jan. 1, 1970 */ long sem_pad2; /* SVABI/386 says I need this here */ long sem_pad3[4]; /* SVABI/386 says I need this here */ }; ==================================== ========== doio.c =========== #ifdef HAS_SEM case OP_SEMCTL: if (cmd == IPC_STAT || cmd == IPC_SET) infosize = sizeof(struct semid_ds); else if (cmd == GETALL || cmd == SETALL) { struct semid_ds semds; #1364--> if (semctl(id, 0, IPC_STAT, &semds) == -1) return -1; getinfo = (cmd == GETALL); infosize = semds.sem_nsems * sizeof(short); /* "short" is technically wrong but much more portable than guessing about u_?short(_t)? */ } break; #endif #ifdef HAS_SEM case OP_SEMCTL: #1410-->ret = semctl(id, n, cmd, (struct semid_ds *)a); break; #endif ============================== => /usr/local/bin/perl -V Summary of my perl5 (5.0 patchlevel 2 subversion 1) configuration: Platform: osname=freebsd, osver=2.1-stable, archname=i586-freebsd uname='freebsd sierra 2.1-stable freebsd 2.1-stable #1: tue may 7 18:40:23 cdt 1996 kroot@sierra:diskssd2freebsd-stablesrcsyscompilesierra i386 ' hint=recommended, useposix=true, d_sigaction=define Compiler: cc='pgcc', optimize='-O2', gccversion=2.7.2p snapshot 960426 cppflags='-I/usr/local/include' ccflags ='-I/usr/local/include' stdchar='char', d_stdstdio=, usevfork=true voidflags=15, castflags=0, d_casti32=, d_castneg=define intsize=4, alignbytes=4, usemymalloc=y, randbits=31 Linker and Libraries: ld='ld', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /usr/lib libs=-lm -lc -lcrypt libc=/usr/lib/libc.so.2.2, so=so Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=define, ccdlflags=' ' cccdlflags='-DPIC -fpic', lddlflags='-Bshareable -L/usr/local/lib' @INC: /usr/local/lib/perl5/i586-freebsd/5.00201 /usr/local/lib/perl5 /usr/local/lib/perl5/site_perl/i586-freebsd /usr/local/lib/perl5/site_perl .
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605141946.OAA04778>