This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Warning: #177-D: subscript out of range

Hi all,

While compiling the source code ,I am getting warning saying as #177-D: subscript out of range.

The below line is the one I am trying to compile,

uip_ip6addr(&unicast_conn->ripaddr, 0xfe80, 0, 0, 0, 0, 0, 0, 0);

and its macro expansion is

/** * Construct an IPv6 address from eight 16-bit words. * * This function constructs an IPv6 address. * * \hideinitializer */

#define uip_ip6addr(addr, addr0,addr1,addr2,addr3,addr4,addr5,addr6,addr7)

 

    (addr)->u16[0] = UIP_HTONS(addr0);                                      \

    (addr)->u16[1] = UIP_HTONS(addr1);                                      \
    (addr)->u16[2] = UIP_HTONS(addr2);                                      \
    (addr)->u16[3] = UIP_HTONS(addr3);                                      \
    (addr)->u16[4] = UIP_HTONS(addr4);                                      \
    (addr)->u16[5] = UIP_HTONS(addr5);                                      \
    (addr)->u16[6] = UIP_HTONS(addr6);                                      \
    (addr)->u16[7] = UIP_HTONS(addr7);                                      \

} while(0)

and It is expanding in the preprocessor as

do { (&unicast_conn->ripaddr)->u16[0] = (uint16_t)((((uint16_t) (0xfe80)) << 8) | (((uint16_t) (0xfe80)) >> 8)); (&unicast_conn->ripaddr)->u16[1] = (uint16_t)((((uint16_t) (0)) << 8) | (((uint16_t) (0)) >> 8)); (&unicast_conn->ripaddr)->u16[2] = (uint16_t)((((uint16_t) (0)) << 8) | (((uint16_t) (0)) >> 8)); (&unicast_conn->ripaddr)->u16[3] = (uint16_t)((((uint16_t) (0)) << 8) | (((uint16_t) (0)) >> 8)); (&unicast_conn->ripaddr)->u16[4] = (uint16_t)((((uint16_t) (0)) << 8) | (((uint16_t) (0)) >> 8)); (&unicast_conn->ripaddr)->u16[5] = (uint16_t)((((uint16_t) (0)) << 8) | (((uint16_t) (0)) >> 8)); (&unicast_conn->ripaddr)->u16[6] = (uint16_t)((((uint16_t) (0)) << 8) | (((uint16_t) (0)) >> 8)); (&unicast_conn->ripaddr)->u16[7] = (uint16_t)((((uint16_t) (0)) << 8) | (((uint16_t) (0)) >> 8)); } while(0);

Please let me know how to get rid that warning. Thanks ,

Jagas