After unreachable code wrong error msg

Started by
1 comment, last by WitchLord 11 years, 4 months ago
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
Advertisement
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 - Tower - free puzzle game

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 - Tower - free puzzle game

This topic is closed to new replies.

Advertisement