Skip to main content
GameDev.net gamedev.net
🔒 Locked

After unreachable code wrong error msg

Started by zerochen Nov 22, 2012 at 11:55 PM 1 replies 1.4k views
Original Post
zerochen
zerochen
Hi,

this code leads to a wrong error msg.


void dum()
{}

int dummy()
{
return 0;
dum();
//return 1;
}

output:
player.as (35, 2) : INFO : Compiling int CPlayer::dummy()
player.as (38, 3) : WARN : Unreachable code
player.as (36, 2) : ERR : Not all paths return a value

If you uncomment the last line it works. it works also with an int a; instead of a func call
WitchLord
WitchLord
Thanks. I'll look into this.

Regards,
Andreas
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - <a href="http://www.angelcode.com/tower" rel
WitchLord
WitchLord
I've fixed this in revision 1482.

Besides removing the misleading 'Not all paths return a value', I also change the message 'Unreachable code' to be an error rather than a warning.

Regards,
Andreas
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - <a href="http://www.angelcode.com/tower" rel

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.