Constantin
Constantin

Reputation: 8961

Unused Entity Issue "Expression result unused" XCode 4 (Clang LLVM)

The following C/C++ code results in an Unused Entity Issue with XCode 4 (Clang LLVM).

void stringMethod(const char *string){
  while(*string!=0){
    *string++;
    //...
  }
}

Its on that line: *string++; so it seems like clang didnt realize that the pointer address is increased? I don't get, how to adjust this code... Any ideas?

Upvotes: 1

Views: 1701

Answers (1)

Giuseppe Ottaviano
Giuseppe Ottaviano

Reputation: 4633

Try to remove the dereferencing operator *, you don't need to dereference the pointer when you increase it.

Upvotes: 3

Related Questions