0
votes

This program is being run in Contiki simulator Cooja.

This is the line giving error:

n=(known_interest_list[*i].head_neighbour_list);
  • n is a struct neighbour * (pointer)
  • head_neighbour_list is pointer to head of a list of struct neighbour type elements
  • known_interest_list is an array of structs

The structures are defined as follows:

struct neighbor {
  struct neighbor *next;
  rimeaddr_t addr;
  int last_rssi, last_lqi;
  int count;
  int update_time;
};

struct  known_interest{
    struct neighbour *head_neighbour_list;
    int count;
    int interest_no;
};

struct known_interest known_interest_list[MAX_INTERESTS];

The error is:

uniBroad.c:221:10: warning: assignment from incompatible pointer type [enabled by default]

I know this is a very basic error, but I have absolutely ensured that data types of both sides of assignment statement are same. Still, this error is not getting resolved.

1
what is inside of the list structure? - Ryan Haining
There's not enough information in the question to diagnose the problem. You might want to add the actual structure definitions and variable declarations. What you've described seems correct, so the problem must be in the details. - user3386109
@RyanHaining , user3386109: I've added the struct definitions now - user3007493
You've spelled neighbor neighbour two different ways. Is that a typo, or is that actually in the code? - user3386109

1 Answers

0
votes

It seems to be an issue with locales ;). Unless you have a typo only here in the question, there are two different struct neighbo[u]r types

struct neighbour *head_neighbour_list // in the known_interest
struct neighbor *next // in the struct neighbor itself

There's an extra u in the known_interest