Occasional compiler glitch

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
Aresby
Posts: 64
Joined: Fri Mar 16, 2012 8:35 am
Location: Milton Keynes, UK
Contact:

Occasional compiler glitch

Post by Aresby » Sat Mar 24, 2012 10:15 am

Once in a while (once in perhaps 20 times) when I compile/build I get an error in "system" (sysModule) on line 41: SB_SV6H As Byte Absolute $15,

The compiler at that point has several error message starting with:

Code: Select all

[Error] system.bas(41): 'POSTINC0' not found
followed by more of the same but referring to other registers

and also

Code: Select all

[Error] 18F25K20.BAS(182): 'RCSTA' not found
followed by a few more, referring to other registers.

An "err" file is created when this happens which states:

Code: Select all

Message[308] C:\DOCUME~1\RALPH\LOCALS~1\TEMP\ASL.SBA 8 : Warning level superseded by command line value. (2)
The solution is just to press F9 / F10 again and all is well - but is there a cure for this?

On this computer I'm running XP SP3 but I'm pretty sure it happened on my Win 7 computer too.
Aresby
Swordfish & PIC Newbie

Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Post by Jerry Messina » Sat Mar 24, 2012 11:57 am

I run XP SP3 too. Normally I don't have any problems.

Some things to try:

Turn off 'Explore Includes'. In the right-hand side of the Code Explorer pane there is a drop down arrow which gets you access to this. Normally, this is only an issue if you're working with a very large number of files, say > 100.

If you have multiple files open in the IDE, make sure that your main program file has focus before trying to compile, otherwise you'll have issues.

You can also set the compiler to always use your main file by clicking on its title bar at the top of the editor window. When you do this, the title will change to a star along with a message like " The program 'filename' is the compiler build root file". That way you can hit compile from any open editor window.

And lastly (and this can be tricky), make sure you don't end up with include file recursion where 'include FileA' -> includes FileB -> includes FileA. That takes a bit of thinking, esp if you're used to C and .h files. Sometimes you end up creating another module (FileC) to hold routines/vars and include that in FileA and FileB.

Aresby
Posts: 64
Joined: Fri Mar 16, 2012 8:35 am
Location: Milton Keynes, UK
Contact:

Post by Aresby » Sat Mar 24, 2012 7:16 pm

Thanks for those tips, Jerry.

I checked I had no recursive calls and did everything else you suggested.

Unfortunately I tried them all and, if anything, the problem got worse. It probably happens now about one in ten compilations.

I'll try and do some more formal tests to see if it can be repeatable.
Aresby
Swordfish & PIC Newbie

Post Reply