Skip to main content
Topic: Repeated warning on unused variable sp (Read 2064 times) previous topic - next topic

Repeated warning on unused variable sp

When compiling the source code there is quite a lot of warnings spit out - which makes it difficult to see if there is a real problem. One of the most frequent warnings is:
Code: [Select]
bauer/../simwerkz.h:94: warning: unused parameter ‘sp’
bauer/../simwerkz.h:108: warning: unused parameter ‘sp’
The two lines are identical:
Code: [Select]
virtual image_id get_icon(spieler_t *sp) const { return grund_t::underground_mode==grund_t::ugm_all ? IMG_LEER : icon; }
By removing the 'sp' and changing these to:
Code: [Select]
virtual image_id get_icon(spieler_t *) const { return grund_t::underground_mode==grund_t::ugm_all ? IMG_LEER : icon; }
I am able to compile without these warning messages, and the game starts and I see no immediate ill effect to the tool bar - however I am not a coder, so there might be something I have overlooked.

Re: Repeated warning on unused variable sp

Reply #1
Your change does not harm.

Does anybody knows how to get rid of such a warning with the help of a script? I dont feel like editing 100 and delete superflous parameter names..
Parsley, sage, rosemary, and maggikraut.

Re: Repeated warning on unused variable sp

Reply #2
There is no save way; even more since different compilers on different architektures spit different warnings.