Jump to content
Sign in to follow this  
LcSD53

Missing Semicolon Error Pointing To Main()

Recommended Posts

/*
BoostC Optimizing C Compiler Version 2.2.5 Beta (for PIC16 architecture)
...
else_bug.c(11): error: missing semicolon
...
NOTE: near 2 hours to find in the middle of a 
very big main function (many hundred lines)
*/
#include <system.h>
char a, b;
void main()  // <<== missing semicolon error points here
{
 if (a == 0)
   b = 1;
   a = 1;   // after this line was inserted
 else       // this else doesn´t match the if anymore
   b = 0;
 for (;;);
}

Share this post


Link to post
Share on other sites
/*
BoostC Optimizing C Compiler Version 2.2.5 Beta (for PIC16 architecture)
...
else_bug.c(11): error: missing semicolon
...
NOTE: near 2 hours to find in the middle of a 
   very big main function (many hundred lines)
*/
#include <system.h>
char a, b;
void main()  // <<== missing semicolon error points here
{
 if (a == 0)
   b = 1;
   a = 1;   // after this line was inserted
 else       // this else doesn´t match the if anymore
   b = 0;
 for (;;);
}

 

 

That is not a bug. Enclose the statements in { and } after if and else when you have more than 1 (one)

 

With best regards,

 

 

Frans.

Share this post


Link to post
Share on other sites

Sure there is an error in the code. But the compiler not giving you any clue about this error or its location ... any reason not to name this a BUG?

Share this post


Link to post
Share on other sites

LcSD53,

 

Sure there is an error in the code. But the compiler not giving you any clue about this error or its location ... any reason not to name this a BUG?

 

Its not a bug, but could be called a limitation.

 

Regards

Dave

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...