Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Suggestion about r8512 commit
daniloz:
Hi,
I've seen a lot of warnings that after r8512 (cbPlugin API change: replaced pure virtual functions with empty implementations, removing the necessity for every plugin to implement them, regardless of actual need.).
The warning is: "include/cbplugin.h:169:62: warning: no return statement in function returning non-void [-Wreturn-type]"
It comes from the new definition of BuildToolBar
--- Code: ---virtual bool BuildToolBar(wxToolBar* /* toolBar */) {}
--- End code ---
The way I see it, it should be:
--- Code: ---virtual bool BuildToolBar(wxToolBar* /* toolBar */) { return false; }
--- End code ---
Not really a problem though... I just thought it would be nice to report and get rid of the warnings... ;-)
oBFusCATed:
--- Quote from: daniloz on November 07, 2012, 08:43:17 am ---Not really a problem though... I just thought it would be nice to report and get rid of the warnings... ;-)
--- End quote ---
In fact it is really a problem, because now this function returns random stuff :)
thomas: Please put -Werror=no-return in you advanced warning options, it catches such errors without a miss :)
MortenMacFly:
--- Quote from: daniloz on November 07, 2012, 08:43:17 am ---The way I see it, it should be:
--- Code: ---virtual bool BuildToolBar(wxToolBar* /* toolBar */) { return false; }
--- End code ---
--- End quote ---
I had spotted this, too alreaedy - just was too lazy, to commit.
--- Quote from: oBFusCATed on November 07, 2012, 09:10:45 am ---thomas: Please put -Werror=no-return in you advanced warning options, it catches such errors without a miss :)
--- End quote ---
Good point. Why don't we enforce a certain set of warnings to all project files? Whcih would be most wise?
dmoore:
--- Quote from: MortenMacFly on November 07, 2012, 10:07:50 am ---
--- Quote from: oBFusCATed on November 07, 2012, 09:10:45 am ---thomas: Please put -Werror=no-return in you advanced warning options, it catches such errors without a miss :)
--- End quote ---
Good point. Why don't we enforce a certain set of warnings to all project files? Whcih would be most wise?
--- End quote ---
Please do. You will have to correct far fewer of my script monkey mistakes if you do. Now if only you could get me to follow the style guide :)
thomas:
--- Quote ----Werror=no-return
--- End quote ---
Good point, will do.
Note: -Werror=return-type it is.
Navigation
[0] Message Index
[#] Next page
Go to full version