Date: Mon, 21 Feb 2005 17:58:44 +1100 From: Peter Jeremy <PeterJeremy@optushome.com.au> To: Kathy Quinlan <kat-free@kaqelectronics.dyndns.org> Cc: Freebsd-hackers@freebsd.org Subject: Re: Error in my C programming Message-ID: <20050221065844.GB81063@cirb503493.alcatel.com.au> In-Reply-To: <4218DEC5.1080600@kaqelectronics.dyndns.org> References: <4218B960.1050403@kaqelectronics.dyndns.org> <20050220183219.GK57256@cirb503493.alcatel.com.au> <4218DEC5.1080600@kaqelectronics.dyndns.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--gKMricLos+KVdGMg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, 2005-Feb-21 03:02:29 +0800, Kathy Quinlan wrote: >Peter Jeremy wrote: >>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. ... >(14) Length = 0x00; >(15) Receiver = 0x00; >(16) Node = 0xFF; ... >unsigned char Length , Network , Receiver , Node , Command = 0x00; ... >Wtrend_Drivers.c:15: conflicting types for `Receiver' >Wtrend_Drivers.h:9: previous declaration of `Receiver' I'm unable to reproduce this with any of gcc2.95.4, gcc3.2.3 or gcc3.4.2 using the attached code. The cause of the problem is somewhere outside the code fragments you've posted. I suggest you try: gcc -E -P Wtrend_Drivers.c > foo.c gcc -c foo.c Then look at the lines in foo.c around the reported error(s). If you can't see the problem, chop down foo.c until you have something that is reasonable in size and safe to post and post the entire file. You might also like to indicate what version of FreeBSD you are running and the output from 'gcc -v'. I presume that you've verified that there are no non-ASCII characters in or near the lines in question that might be confusing things. -- Peter Jeremy --gKMricLos+KVdGMg Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="foo.c" #define Reset 0 #define Head 0 #define p_Data 0 unsigned char Length , Network , Receiver , Node , Command = 0x00; void Make_Packet_Send(int, int, int, int, int, int, int); void Reset_Network (unsigned char Network) { Length = 0x00; Receiver = 0x00; Node = 0xFF; Command = Reset; Make_Packet_Send(Head , Length, Network, Receiver, Node, Command, p_Data); } --gKMricLos+KVdGMg--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050221065844.GB81063>