Hi,
I'm trying to compile a project using gcc and I got the following error message:
saw.h:52: error: syntax error before "conn_state"
saw.h:52: warning: no semicolon at end of struct or union
saw.h:58: error: syntax error before "}" token
saw.h:58: warning: type defaults to ˜int" in declaration of "state_t"
saw.h:58: warning: data definition has no type or storage class
saw.h:60: error: syntax error before "s"
saw.h:60: warning: type defaults to "int" in declaration of "s"
saw.h:60: warning: data definition has no type or storage class
Here's the code the errors are referring to:
Code:
enum conn_state {
CLOSED=0,
SYN_SENT,
SYN_RCVD,
ESTABLISHED,
FIN_SENT,
FIN_RCVD
};
typedef struct {
conn_state state; //line 52
uint8_t current_seqnum;
struct sockaddr_in other;
socklen_t otherLen;
int duplicate;
/* What should go here? */
} state_t;
extern state_t s;
I tried checking online and in my books and I think I'm using the right syntax. Does anyone know what I'm doing wrong? Thanks!