• MPLAB XC8
  • Position variables at specific location with XC8 Compiler v2.31
2020/11/26 13:01:22
Derwys
Hello,
 
I’m using the code int Table[20] @ 0x400; to allocate an array at memory location 0x400 and compiler XC8 Ver 2.31 return an error “expected  ‘;’ after top level declarator”
 
Do you know what it means, or what’s wrong?


Thanks...
2020/11/26 13:31:38
dan1138
derwys
I’m using the code int Table[20] @ 0x400; to allocate an array at memory location 0x400 and compiler XC8 Ver 2.31 return an error “expected  ‘;’ after top level declarator”
 
Do you know what it means, or what’s wrong?



The at ('@') symbol is no longer valid syntax with the XC8 v2.31 compiler.
 
I would suggest you read the XC8 User's Guide.
 
For most installation the PDF can be found here:
 
<YourPathMyVary>/xc8/v2.31/docs/MPLAB_XC8_C_Compiler_User_Guide_for_PIC.pdf
2020/11/26 16:00:40
BroadwellConsultingInc
Also, once you start using the proper qualifiers, make sure you set the compiler Address Qualifiers option to "Request" or "Require".  The default is "Ignore", which will make the compiler cheerfully and without warning ignore your attempts to locate your variables.  Thanks for Ric for pointing this out to me on a prior thread.
2020/11/26 22:13:24
Derwys
Thanks you all for your comments, I read user‘s guide and information  in your links and I could solve the issue.
 
I replaced @ 0x400 by __at(0x400) in code line and it work perfect.
© 2021 APG vNext Commercial Version 4.5

Use My Existing Forum Account