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
virtual bool BuildToolBar(wxToolBar* /* toolBar */) {}
The way I see it, it should be:
virtual bool BuildToolBar(wxToolBar* /* toolBar */) { return false; }
Not really a problem though... I just thought it would be nice to report and get rid of the warnings... ;-)
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... ;-)
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 :)
Quote from: daniloz on November 07, 2012, 08:43:17 AM
The way I see it, it should be:
virtual bool BuildToolBar(wxToolBar* /* toolBar */) { return false; }
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 :)
Good point. Why don't we enforce a certain set of warnings to
all project files? Whcih would be most wise?
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 :)
Good point. Why don't we enforce a certain set of warnings to all project files? Whcih would be most wise?
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 :)
Quote-Werror=no-return
Good point, will do.
Note:
-Werror=return-type it is.
Quote from: MortenMacFly on November 07, 2012, 10:07:50 AM
Good point. Why don't we enforce a certain set of warnings to all project files? Whcih would be most wise?
Because gcc-4.1.2 doesn't support this one (for my home computer I have it enabled for all projects :) )
And because we won't agree on the list of warnings to enable. :)
Quote from: oBFusCATed on November 07, 2012, 07:41:59 PM
Quote from: MortenMacFly on November 07, 2012, 10:07:50 AM
Good point. Why don't we enforce a certain set of warnings to all project files? Whcih would be most wise?
Because gcc-4.1.2 doesn't support this one (for my home computer I have it enabled for all projects :) )
And because we won't agree on the list of warnings to enable. :)
or we write some scripts for CB (put them in svn and have the cbp file use them, detecting the gcc version, and when high enough enable it. I remember we have done this before fpr something (I thin kI even did it, but can't remember) ...
Quote from: killerbot on November 07, 2012, 10:48:11 PM
I remember we have done this before fpr something (I thin kI even did it, but can't remember) ...
It was for the PCH stuff, or some warnings - I recall, too. It should still be in SVN somewhere or it has been merged to the project file as script.
Quote from: MortenMacFly on November 08, 2012, 08:45:59 AM
Quote from: killerbot on November 07, 2012, 10:48:11 PM
I remember we have done this before fpr something (I thin kI even did it, but can't remember) ...
It was for the PCH stuff, or some warnings - I recall, too. It should still be in SVN somewhere or it has been merged to the project file as script.
http://svn.berlios.de/wsvn/codeblocks/trunk/src/cbgcc420.script?peg=6000 (http://svn.berlios.de/wsvn/codeblocks/trunk/src/cbgcc420.script?peg=6000)
Quote from: jens on November 08, 2012, 09:43:27 AM
http://svn.berlios.de/wsvn/codeblocks/trunk/src/cbgcc420.script?peg=6000 (http://svn.berlios.de/wsvn/codeblocks/trunk/src/cbgcc420.script?peg=6000)
Exactly! And that's how we can do it properly, too btw. I didn't know it was a warning in the end, too...