Good morning,
I am doing a program in C where I need to execute the following block of code:
uint8_t local_index=0;
uint8_t buffer_start[100];
uint16_t temporal_uint16;
temporal_uint16 = (uint16_t) (buffer_start[local_index++] << 8) | buffer_start[local_index++];
The idea is to take two consecutive bytes of an array (depending on the value of local_index at that moment) and put them inside a variable of the type uint16_t doing logical operations.
The program is working correctly, but compiling it produces the following warning and I would like to understand why:
"operation on 'local_index' may be undefined"
I have other alternatives to solve the problem, what I want is to simply understand the why of that warning, since in my opinion the syntax of the code line is correct.
Thank you very much!