Andrew Leiper 0 Posted January 28, 2011 Report Share Posted January 28, 2011 Hi Pavel, boostc v7.01 PIC18F2525 Windows XP The following code generates an "Access violation at 0x00493221 tried to read from 0x00000000". Changing the 300 to 0 or removing some of the |'d values allows it to compile. ///////////////////////////////////////// #include <system.h> typedef struct { unsigned short w; unsigned char d; } TTestStruct; const TTestStruct InitStruct = { 300, ( (0 << 0) | (0 << 2) | (0 << 4) ) }; ///////////////////////////////////////// Hopefully that will be it for the bug reports from me for now as my project is now compiling !! Now I just have to test that it works. Cheers, Andy Leiper IET Ltd Quote Link to post Share on other sites
Reynard 0 Posted January 28, 2011 Report Share Posted January 28, 2011 (edited) Hi Pavel, Since we are on the subject if Access Violation, here is another piece of code which generates one. "0x0047032D, read from 0x0000050" #include <system.h> typedef unsigned char BYTE; typedef unsigned int WORD; typedef union { WORD Val; BYTE v[2]; } WORD_VAL; void main() { WORD ChunkLen; myDWord.Val = 0; if(((WORD_VAL*)&ChunkLen)->bits.b0) { ChunkLen++; } } SB 7.01, PIC18F4580, XP Pro SP3. It is not SB code, but, like Andrew I am doing a MChip C18 port. Cheers Reynard ps. ignore the myDWord.Val = 0; bit of code. Edited January 28, 2011 by Reynard Quote Link to post Share on other sites
Recommended Posts
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.