This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Code compilation issues with PIC / XC8 - expression generates no code

Hi,

The following function:

void acil_encode_cmd_setup(uint8_t *buffer, aci_cmd_params_setup_t *p_aci_cmd_params_setup, uint8_t setup_data_size) { *(buffer + OFFSET_ACI_CMD_T_LEN) = setup_data_size + MSG_SETUP_CMD_BASE_LEN; *(buffer + OFFSET_ACI_CMD_T_CMD_OPCODE) = ACI_CMD_SETUP; memcpy((buffer + OFFSET_ACI_CMD_T_SETUP), &(p_aci_cmd_params_setup->setup_data[0]), setup_data_size); }

is generating the following warning in XC8 compiler (PIC): ../BLE_nRF8001/acilib.c:221: warning: (1498) pointer (acil_encode_cmd_setup@buffer) in expression may have no targets ../BLE_nRF8001/acilib.c:221: warning: (759) expression generates no code ../BLE_nRF8001/acilib.c:222: warning: (1498) pointer (acil_encode_cmd_setup@buffer) in expression may have no targets ../BLE_nRF8001/acilib.c:222: warning: (759) expression generates no code

I am not worried about warning 1498, but 759, expression generates no code, is bugging me, since for me this is not a warning, it is a big problem and also the code seems fine and there is no reason for this kind of warning. I tried putting some casts but the problem persists.

I am using PIC XC8 compiler.

P.S.: This was just an example these warning are appearing practically everywhere in acilib.c P.S2: I am not having problem when testing the software in the hardware, but these warning are keeping a buzz in my ears.

Related