Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: daniloz on November 07, 2012, 08:43:17 am

Title: Suggestion about r8512 commit
Post by: daniloz on November 07, 2012, 08:43:17 am
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 */) {}

The way I see it, it should be:
Code
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... ;-)
Title: Re: Suggestion about r8512 commit
Post by: oBFusCATed on November 07, 2012, 09:10:45 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 :)
Title: Re: Suggestion about r8512 commit
Post by: MortenMacFly on November 07, 2012, 10:07:50 am
The way I see it, it should be:
Code
virtual bool BuildToolBar(wxToolBar* /* toolBar */) { return false; }
I had spotted this, too alreaedy - just was too lazy, to commit.

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?
Title: Re: Suggestion about r8512 commit
Post by: dmoore on November 07, 2012, 01:07:29 pm
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 :)
Title: Re: Suggestion about r8512 commit
Post by: thomas on November 07, 2012, 02:21:02 pm
Quote
-Werror=no-return
Good point, will do.

Note: -Werror=return-type it is.
Title: Re: Suggestion about r8512 commit
Post by: oBFusCATed on November 07, 2012, 07:41:59 pm
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. :)
Title: Re: Suggestion about r8512 commit
Post by: killerbot on November 07, 2012, 10:48:11 pm
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) ...
Title: Re: Suggestion about r8512 commit
Post by: MortenMacFly on November 08, 2012, 08:45:59 am
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.
Title: Re: Suggestion about r8512 commit
Post by: Jenna on November 08, 2012, 09:43:27 am
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)
Title: Re: Suggestion about r8512 commit
Post by: MortenMacFly on November 08, 2012, 10:38:49 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...