Jump to content
Sign in to follow this  
rlang

Boostc Compiler Error

Recommended Posts

The coding below has two functionally identical sections. The section that is currently commented out compiles and runs as expected. The section that is currently uncommented gives the debug3.c(28): error: missing semicolon message. This appears to be a compiler inconsistency problem.

 

#include <system.h>

void main()

{

unsigned char vector;

unsigned char v;

unsigned char i;

unsigned char buffer [4];

const signed char table [] = {-4, -4, -4, 0, 4, 4, 4, 0};

vector=0;

trisb = 0; //configure port B

portb = 0;

i=1;

 

while (1)

{

// if (i > 0) { // Increment octogon vectors

// v=vector & 0x07;

// buffer[1] = table[v]; // X vector (limit to length of table array)

// v=(vector+2) & 0x07;

// buffer[2] = table[v]; // Y vector (leads X by two)

// portb=i; // (limit to length of table array)

// i++;

// vector++;

// }

 

if (i > 0) { // Increment octogon vectors

buffer[1] = table[vector & 0x07];

// X vector (limit to length of table array)

buffer[2] = table[(vector+2) & 0x07];

// Y vector (leads X by two)

portb=i; // (limit to length of table array) i++;

vector++;

}

}

}

 

BoostC Optimizing C Compiler Version 1.6 Alpha (for PIC16 architecture)

debug3.c(28): error: missing semicolon

failure

Exit code was 1.

Share this post


Link to post
Share on other sites

rlang,

 

I would recommend that you start using Sourceboost version 1.7.

 

Anyway it looks like a compiler issue.

 

Work around for now is to put brackets around the expression in square brackets.

 

buffer[1] = table[vector & 0x07];

change to

buffer[1] = table[(vector & 0x07)];

 

 

Regards

Dave

Share this post


Link to post
Share on other sites
rlang,

 

I would recommend that you start using Sourceboost version 1.7.

 

Anyway it looks like a compiler issue.

 

Work around for now is to put brackets around the expression in square brackets.

 

buffer[1] = table[vector & 0x07];

change to

buffer[1] = table[(vector & 0x07)];

 

 

Regards

Dave

 

I switched to 1.7 which gave the same error, but thanks for the tip on parentheses, that also worked fine as the workaround I reported.

 

Rob

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