From owner-freebsd-hackers Fri Oct 23 13:12:08 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA05804 for freebsd-hackers-outgoing; Fri, 23 Oct 1998 13:12:08 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from symbion.srrc.usda.gov ([199.78.118.118]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA05750 for ; Fri, 23 Oct 1998 13:11:55 -0700 (PDT) (envelope-from glenn@nola.srrc.usda.gov) Received: from nola.srrc.usda.gov (localhost.srrc.usda.gov [127.0.0.1]) by symbion.srrc.usda.gov (8.9.1/8.9.1) with ESMTP id PAA00764 for ; Fri, 23 Oct 1998 15:11:03 -0500 (CDT) (envelope-from glenn@nola.srrc.usda.gov) Message-Id: <199810232011.PAA00764@symbion.srrc.usda.gov> X-Mailer: exmh version 2.0.2 2/24/98 To: freebsd-hackers@FreeBSD.ORG From: Glenn Johnson Subject: reconciling different defines in header files between Linux and FreeBSD Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 23 Oct 1998 15:11:03 -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Greetings, I am trying to compile code on FreeBSD 3.0 that was written with Linux in mind. The following code snippet is where it is failing: void galloc_ (nwords, wordsize, iclear, refarray, offset) f77_int *nwords, *wordsize, *iclear; offset_type *offset; f77_wp *refarray; { f77_wp *gmalloc(); size_t nbytes; offset_type n; #ifdef DO_SHM int shmflags = 0; void *brkadr, *sbrk(); key_t shmkey; The error that I get is: bsd/mdutil.c: In function `galloc_': bsd/mdutil.c:2630: conflicting types for `sbrk' /usr/include/unistd.h:168: previous declaration of `sbrk' bsd/mdutil.c:2630: warning: extern declaration of `sbrk' doesn't match global one sbrk is defined in in FreeBSD as: char *sbrk __P((int)); sbrk is defined in in Linux as: extern __ptr_t __sbrk __P ((ptrdiff_t __delta)); extern __ptr_t sbrk __P ((ptrdiff_t __delta)); What is the right way to reconcile my code? Do I need to redefine sbrk in the source file as extern or do I make the call explicitly char? Thanks in advance. -- Glenn Johnson Technician USDA, ARS, SRRC New Orleans, LA To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message