Variables defined, (sometimes) assigned, and never used
When compiling with flag W=1 a lot of warnings about variables defined but never used show up. If one read the source sometimes it's clear that the original author placed them there because she/he wants to use the variable for doing something in a future release of the driver. I've also seen a comment like /* TODO */ near some unused variables.
I thought to delete a couple of variables that are declared, may be also assigned as a result of some expression, but neither used within a function or returned to the caller.
What to do with those (currently) unnecessary variables? Should we remove them or let everything as is?
Thanks,
Fabio
Quoted 6 lines · Fabio M. De Francesco
When compiling with flag W=1 a lot of warnings about variables defined but never used show up. If one read the source sometimes it's clear that the original author placed them there because she/he wants to use the variable for doing something in a future release of the driver. I've also seen a comment like /* TODO */ near some unused variables.
Quoted 6 lines
I thought to delete a couple of variables that are declared, may be also assigned as a result of some expression, but neither used within a function or returned to the caller.
What to do with those (currently) unnecessary variables? Should we remove them or let everything as is?
Generally, code that is not used is not wanted. But use some common sense.
Be sure to compile the code. It can happen that the variable is only used by a macro. Not very nice, but it can happen.
julia
Quoted 15 lines · CEST Julia Lawall
Quoted 6 lines · Fabio M. De Francesco
When compiling with flag W=1 a lot of warnings about variables defined but never used show up. If one read the source sometimes it's clear that the original author placed them there because she/he wants to use the variable for doing something in a future release of the driver. I've also seen a comment like /* TODO */ near some unused variables.
Quoted 7 lines
I thought to delete a couple of variables that are declared, may be also
assigned as a result of some expression, but neither used within a function or returned to the caller.What to do with those (currently) unnecessary variables? Should we remove them or let everything as is?
Quoted 7 lines
Generally, code that is not used is not wanted. But use some common sense.
Be sure to compile the code. It can happen that the variable is only used by a macro. Not very nice, but it can happen.
julia
I'll check carefully that the resulting code can still work. I'm a bit tired of removing camelcase and the like :(
Thanks,
Fabio