Jump to content
Sign in to follow this  
SnakeByte

Bug With Boostc 1.6alpha

Recommended Posts

Heya Pavel,

I hope you don't mind me doing this... The first bug I found while trying to compile real code, but now I'm just stress testing your compiler. Is it too soon for this? Should I just e-mail you directly with anything more that I find?

 

Here's the example code:

 

char badReturn(int good, int evil)

{

if (good < evil)

{

return 666;

}

else

{

return 1;

}

}

 

 

void main()

{

 

}

 

As you can see, it's impossible for the badReturn function to NOT return something, yet I get this error:

 

compilertest.c(3:2): error: function 'badReturn' has return type 'unsigned char' and

must return a value

Share this post


Link to post
Share on other sites

Yes this error was already reported in this forum. A workaround is to write code like:

char badReturn(int good, int evil)
{
 if (good < evil)
 {
   return 666;
 }
 return 1;
}

 

Regards,

Pavel

Share this post


Link to post
Share on other sites
Yes this error was already reported in this forum. A workaround is to write code like:

char badReturn(int good, int evil)
{
 if (good < evil)
 {
   return 666;
 }
 return 1;
}

 

Regards,

Pavel

 

Sorry about that. I thought all previously mentioned bugs were fixed, and didn't see any bugs posted the last time a ran through the forum this morning for 1.6 alpha. I see that tobik? found this one back in September, but that it slipped through the cracks.

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...