I'm maintaining some ugly legacy code with the following function and I am getting
warning: value computed is not used
for the lines marked by comments below:
void ReadKeyValuePipe(char* buffer, char* key, char* value) {
    char* pos;
    char key_str[1024];
    char* val = value;
    sprintf(key_str,"%s:",key);
    if((pos = strstr(buffer,key))) {
        pos += strlen(key_str);
        while (*pos && *pos != '|') {
            *val = *pos;
            *val++; // this is actually used
            *pos++; // so is this
        }
        *val = 0;
    }
}
When I remove those lines, the code breaks. Which makes sense because they appear to be incremented markers.
How do I get the compiler to recognize that these calculations are actually used?
 
     
    