Re: [Audacity-devel] Patch to correct constness two variables in LabelTrack.cpp
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
|
From: Dawson W. <wri...@gm...> - 2008-08-31 20:16:15
|
Richard Ash wrote: > Committed. Just out of interest, do you have a compiler / set of options > that actually generates a warning for this? I was using the 4.3.1 versions of gcc/g++/cpp and used -Wall and -Wextra. If you do, be prepared to weed out the unused variable, parameter warnings, etc. It should help get rid of warnings that could come up when the compiler programmers decide to move a category of warnings into the mainstream warnings... the ones that come out of nowhere. Also with code being compiled by multiple compilers, it would just take one of them to make the first move to start complaining with warnings or errors. > I haven't ever seen one, > although I can see that it is better practise to retain the const-ness > of the data so the compiler doesn't end up making internal copies of it, > and can tell if something that shouldn't is altering the data. > > That is one of the reasons I do it. Others are it helps catch errors at compile time when making later modifications to prevent it from altering data that the rest of the code assumes to remain constant and it also makes for better self-documenting code. Taking care of it in the application code will make it easier to locate the ones in the libraries and imported code. There are quite a bit of that, too. Which brings me to this question.... In those cases, do I make a patch on the code with the Audacity's CVS code, or should that be made on the code upstream and mentioned here? How does that work? I don't want to waste anyone's time or lose code in the mix going to the wrong place. Dawson |