Jump to content

  • Log In with Google      Sign In   
  • Create Account


- - - - -

After unreachable code wrong error msg


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 zerochen   Members   -  Reputation: 492

Like
0Likes
Like

Posted 22 November 2012 - 05:55 PM

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

Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3263

Like
0Likes
Like

Posted 22 November 2012 - 06:18 PM

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

#3 Andreas Jonsson   Moderators   -  Reputation: 3263

Like
0Likes
Like

Posted 27 November 2012 - 07:02 PM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS