User forums > Help
missing 'const' in CompilerCommandGenerator::GetOrderedOptions(...)
(1/1)
mdelfede:
There's a missing 'const' in sdk/CompilerCommandGenerator.cpp :
** Arrange order of options.
* Depending on the order defined for the build target, it concatenates
* @c project_options with @c target_options and returns the result.
*/
wxString CompilerCommandGenerator::GetOrderedOptions(ProjectBuildTarget* target, OptionsRelationType rel, const wxString& project_options, const wxString& target_options)
should be
wxString CompilerCommandGenerator::GetOrderedOptions(const ProjectBuildTarget* target, OptionsRelationType rel, const wxString& project_options, const wxString& target_options)
GCC complains about it.
Ciao
Max
thomas:
My compiler (which happens to be gcc) does not complain about it (and I see no reason why target should be const, either).
Mind posting the full commandline including the exact error message?
mdelfede:
--- Quote from: thomas on July 13, 2006, 09:12:40 pm ---My compiler (which happens to be gcc) does not complain about it (and I see no reason why target should be const, either).
Mind posting the full commandline including the exact error message?
--- End quote ---
Sorry, I forgot the revision, is 2746.
I'll take off the 'const' again and post the mesage...
Here is it :
:: === Code::Blocks, sdk ===
sdk\compilercommandgenerator.cpp:581: error: prototype for `wxString CompilerCommandGenerator::GetOrderedOptions(ProjectBuildTarget*, OptionsRelationType, const wxString&, const wxString&)' does not match any in class `CompilerCommandGenerator'
sdk\compilercommandgenerator.h:42: error: candidate is: virtual wxString CompilerCommandGenerator::GetOrderedOptions(const ProjectBuildTarget*, OptionsRelationType, const wxString&, const wxString&)
:: === Build finished: 2 errors, 0 warnings ===
btw, or the 'target' must be 'const' in cpp file, or he mustn't be const in header file....
Ciao
Max
thomas:
Ah, ok... this was introduced in 2746 and fixed in 2747 :)
You're right, the function's signature was changed.
killerbot:
woops my mistake, somethin went wrong in my merge. My scratch svn was ok, but my commit svn, I forgot the implementation to the change. Sorry ...
By the way, that way you could not see my comment I made to the source ;-)
--- Code: ---wxString CompilerCommandGenerator::GetOrderedOptions(const ProjectBuildTarget* target, OptionsRelationType rel, const wxString& project_options, const wxString& target_options)
{ // NOTE : this should not be a member method, does not use nor alter the state
--- End code ---
By the way, it should be const, since nothing is bound to change to the target argument.
Navigation
[0] Message Index
Go to full version