Author Topic: Suggestion about r8512 commit  (Read 10168 times)

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Suggestion about r8512 commit
« 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... ;-)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Suggestion about r8512 commit
« Reply #1 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 :)
(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!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Re: Suggestion about r8512 commit
« Reply #2 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?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Suggestion about r8512 commit
« Reply #3 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 :)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Suggestion about r8512 commit
« Reply #4 on: November 07, 2012, 02:21:02 pm »
Quote
-Werror=no-return
Good point, will do.

Note: -Werror=return-type it is.
« Last Edit: November 07, 2012, 02:23:38 pm by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Suggestion about r8512 commit
« Reply #5 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. :)
(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!]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5516
Re: Suggestion about r8512 commit
« Reply #6 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) ...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Re: Suggestion about r8512 commit
« Reply #7 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Suggestion about r8512 commit
« Reply #8 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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Re: Suggestion about r8512 commit
« Reply #9 on: November 08, 2012, 10:38:49 am »
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...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ