News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Suggestion about r8512 commit

Started by daniloz, November 07, 2012, 08:43:17 AM

Previous topic - Next topic

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

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... ;-)

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... ;-)
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 :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

MortenMacFly

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?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

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 :)
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 :)
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

thomas

#4
Quote-Werror=no-return
Good point, will do.

Note: -Werror=return-type it is.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

oBFusCATed

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. :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

killerbot

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) ...

MortenMacFly

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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Jenna

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

MortenMacFly

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]