i have this warning (edited) : unused
variable pp
Kudos for respecting (and worrying and asking) the compiler warning message. Keep that up. (I always compile with -Werror
so that "warnings" are treated as "errors." I always find it helpful.)
Quoting from the gcc warnings page:
-Wunused-variable
Warn whenever a local variable or non-constant static
variable is unused aside from its
declaration. This warning is enabled
by -Wall.
Strictly speaking, it does make sense to declare a variable and then not use it. That's the case for pp
and compiler is alerting that. In this particular case,
Following is the code for "no-op" way:
int main() {
int compteur = 1;
int *p = &compteur;
int **pp = &p;
(void) pp; // no-op use of pp
}
For further details on no-op use, see the other thread: http://stackoverflow.com/questions/3986295/what-does-the-following-code-do