Error in my C programming

Peter Jeremy PeterJeremy at optushome.com.au
Sun Feb 20 22:58:50 PST 2005


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
-------------- next part --------------
#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);
   }


More information about the freebsd-hackers mailing list