Jump to content
Sign in to follow this  
MarkM

Very Weird Compiler Bug?

Recommended Posts

Hi

 

My code includes this function:

 

static void
lcd_graphic_rawput(unsigned char *charsrc, unsigned char row, unsigned char nrows, unsigned char col, unsigned char ncols)
{
unsigned char r, c;

for (r = 0; r < nrows; r++) {
	for (c = 0; c < ncols; c++) {
		if (charsrc[(r >> 3) * ncols + c] & (1 << (r & 00000111b)))
			lcd_graphic_setXY_internal(col + c, row + r);
		else
			lcd_graphic_clearXY_internal(col + c, row + r);
	}
}
for (r = (row >> 3); r <= ((row + nrows) >> 3); r++) {
	lcd_pageMin[r] = min(col, lcd_pageMin[r]);
	lcd_pageMax[r] = max((col + ncols), lcd_pageMax[r]);
#ifdef XX_DEBUG
	serial_printf("row = %u\n", (unsigned int)r);
	serial_printf("lcd_pageMin[r] = %u\n", (unsigned int)lcd_pageMin[r]);
	serial_printf("lcd_pageMax[r] = %u\n", (unsigned int)lcd_pageMax[r]);
#endif
}
}

 

The macro XX_DEBUG is not defined. If I try to compile this code I get

 

Building...

BoostC Optimizing C Compiler Version 6.88 (for PIC18 architecture)

http://www.sourceboost.com

Copyright© 2004-2008 Pavel Baranov

Copyright© 2004-2008 David Hobday

 

Licensed to Mark Murray under Single user Full License for 1 node(s)

Limitations: PIC18 max code size:Unlimited, max RAM banks:Unlimited, Non commercial use only

 

 

lcd_graphic.c

C:\Documents and Settings\Mark.GRUMPY\My Documents\My Documents\coxcomp\lcd_graphic.c(176): error: jump to undefined label

 

failure

"C:\Program Files\SourceBoost\boostc.pic18.exe" lcd_graphic.c -t PIC18F2620 -W2 -I boostc_libs_r1_3/libs;m:/font -O1 -Su

Exit code was 1.

Removing target: lcd_graphic.obj

Done

 

... where the undefined label is in some innocent and previously functional piece of code elsewhere in the same file.

 

A workaround is to comment out the #ifdef/#endif block.

 

I've seen this before where simply rearranging code fixes the "problem".

 

I'll guess you'll be wanting to look at the whole project? I can send it if you like.

 

M

Edited by MarkM

Share this post


Link to post
Share on other sites

MarkM,

I'll guess you'll be wanting to look at the whole project? I can send it if you like.
Yes please send a project that exhibits the problem you describe to support@sourceboost.com

 

Regards

Dave

Share this post


Link to post
Share on other sites
MarkM,
I'll guess you'll be wanting to look at the whole project? I can send it if you like.
Yes please send a project that exhibits the problem you describe to support@sourceboost.com

 

Regards

Dave

 

Ah!! Has this problem been fixed??? This has haunted my development for a long time now...

 

BTW, I get around this problem by just adding a few blank lines near the top of the file...

 

Jacob

Edited by Jacob Christ

Share this post


Link to post
Share on other sites
...Ah!! Has this problem been fixed??? This has haunted my development for a long time now...

 

We could not reproduce the problem. Need somebody to send us a project that that will show this error in our environment.

 

Regards,

Pavel

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