From owner-freebsd-hackers@FreeBSD.ORG Sun Feb 20 19:27:37 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B08616A4CE for ; Sun, 20 Feb 2005 19:27:37 +0000 (GMT) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [204.127.202.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAF6543D2D for ; Sun, 20 Feb 2005 19:27:36 +0000 (GMT) (envelope-from garycor@comcast.net) Received: from [10.56.78.111] (pcp09118143pcs.union01.nj.comcast.net[69.142.234.88]) by comcast.net (sccrmhc13) with ESMTP id <200502201927350160009ftie>; Sun, 20 Feb 2005 19:27:36 +0000 Message-ID: <4218E5C8.1050900@comcast.net> Date: Sun, 20 Feb 2005 14:32:24 -0500 From: Gary Corcoran User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kathy Quinlan References: <4218B960.1050403@kaqelectronics.dyndns.org> <20050220183219.GK57256@cirb503493.alcatel.com.au> <4218DEC5.1080600@kaqelectronics.dyndns.org> In-Reply-To: <4218DEC5.1080600@kaqelectronics.dyndns.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: Freebsd-hackers@freebsd.org Subject: Re: Error in my C programming X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Feb 2005 19:27:37 -0000 Kathy Quinlan wrote: > Peter Jeremy wrote: > >> On Mon, 2005-Feb-21 00:22:56 +0800, Kathy Quinlan wrote: >> >>> These are some of the errors I get in pairs for each of the above >>> variables: >>> >>> Wtrend_Drivers.c:15: conflicting types for `Receiver' >>> Wtrend_Drivers.h:9: previous declaration of `Receiver' >> >> >> >> Without knowing exactly what is on those lines, it's difficult to offer >> any concrete suggestions. >> >> Two possible ways forward: >> 1) Change the declaration at Wtrend_Drivers.h:9 to be 'extern' >> 2) Pre-process the source and have a close look at the definitions and >> declarations for Receiver. You may have a stray #define that is >> confusing the type or a missing semicolon. >> >> Peter >> > Here is a section of my code: > > *** Wtrend_Drivers.c *** > > (12)void Reset_Network (unsigned char Network) > (13) { > (14) Length = 0x00; > (15) Receiver = 0x00; > (16) Node = 0xFF; > (17) Command = Reset; > (18) Make_Packet_Send(Head , Length, Network, Receiver, Node, > Command, p_Data); > (19) } > > *** Wtrend_Drivers.h *** > > unsigned char Length , Network , Receiver , Node , Command = 0x00; > > The above is line 9 of the Wtrend_Drivers.h > The numbers in () I have added to show the line numbers in Wtrend_Drivers.c > > These are some of the errors I get in pairs for each of the above > variables: > > Wtrend_Drivers.c:15: conflicting types for `Receiver' > Wtrend_Drivers.h:9: previous declaration of `Receiver' I would try putting the variables in the header file on separate lines. For example: unsigned char Length = 0; unsigned char Network = 0; unsigned char Receiver = 0; etc. Gary