I got an error in file xyz.c error: in function 'xyzz' variable 'i' set but not used [-Werror=unused-but-set-variable] and in that particular line and column, I found (void *) what is the error, can someone please help?
You seem to have assigned a value to your variable i, but not used it afterwards. This would normally not generate an error, but rather a warning (depending on how you have your warning flags set), since the compiler assumes that you wanted to do something with this variable, but forgot about it.
The setting for having this as a warning is -Wunused-but-set-variable
However, you seem to have set this as generating an error: -Werror=unused-but-set-variable
Having (certain or all) warnings as errors can be useful in order to test your code more rigidly. Are you sure you want this here?
See http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html for more options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With