Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c++ Subject: Re: Don't be fooled by cpp.sh Date: Sun, 12 Jan 2020 07:50:30 +1300 Lines: 37 Message-ID: References: <70391932-ccbc-4bc7-b693-881ab06eb6d3@googlegroups.com> <86wo9z47i9.fsf@linuxsc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net mEY8ceIlWpa6b1SNG7mvoAVQUsJcqsk8y7oqI5ABeaVJ/Mv/uH Cancel-Lock: sha1:c3lWeacP6aDe4Ivv7gouQ2lfjwQ= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 In-Reply-To: Content-Language: en-US Xref: csiph.com comp.lang.c++:71293 On 12/01/2020 01:03, David Brown wrote: > On 10/01/2020 17:10, Tim Rentsch wrote: >> Paavo Helde writes: >> >>> On 31.12.2019 19:46, Bonita Montero wrote: >> >> [...] >> >>>> -Wunused-function >>>> This would be disturbing if you would have the function in the >>>> code for a later purpose. >>> >>> So you are checking in untested code. >> >> On the contrary, such unused functions are completely tested: >> any function that is never called cannot possibly misbehave. The >> warning message saying the function is unused is the success >> indicator for testing the function in question. It is only >> functions that are called that might contain program errors. >> > > The people who maintain your code must really love you! > > If you have written code that is not used anywhere, then presumably it > was either used in the past, or it is expected that it might be used in > the future. If it could be used in the future, then it should either be > tested, or it should somehow be marked that it is not tested. And if it > is not going to be used in the future, remove it. > > (Of course there will often be stages in development where it is fine to > check in untested code.) Are there? -- Ian.