News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

build warning in rev 8296 in sqvm.cpp

Started by ollydbg, August 31, 2012, 03:40:56 AM

Previous topic - Next topic

ollydbg

I see such warning:
Quote
||=== Code::Blocks wx2.8.x, Squirrel ===|
sdk\scripting\squirrel\sqvm.cpp||In member function 'bool SQVM::Execute(SQObjectPtr&, SQInteger, SQInteger, SQInteger, SQObjectPtr&, SQBool, SQVM::ExecutionType)':|
sdk\scripting\squirrel\sqvm.cpp|1062|warning: control reaches end of non-void function [-Wreturn-type]|


bool SQVM::Execute(SQObjectPtr &closure, SQInteger target, SQInteger nargs, SQInteger stackbase,SQObjectPtr &outres, SQBool raiseerror,ExecutionType et)
{
....

    assert(0);
}

So, add a "return true"?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

MortenMacFly

Quote from: ollydbg on August 31, 2012, 03:40:56 AM

bool SQVM::Execute(SQObjectPtr &closure, SQInteger target, SQInteger nargs, SQInteger stackbase,SQObjectPtr &outres, SQBool raiseerror,ExecutionType et)
{
....

    assert(0);
}

So, add a "return true"?
You can, but if the assert raises it doesn't really matter as the application is aborted before.
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]

ollydbg

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.