Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Intellisense fail with structure aligment/padding (Read 2621 times)
Serenifly
Junior Member
**
Offline


Posts: 20
Joined: Jun 20th, 2013
Intellisense fail with structure aligment/padding
Oct 21st, 2015 at 4:30pm
Print Post  
You might know that on a 32-Bit system structures are padded to the system's word size:
https://en.wikipedia.org/wiki/Data_structure_alignment

This isn't an issue on the 8-Bit AVRs. This prints "7" as one would naively assume (4 + 2 + 1):
Code
Select All
struct integerData_t
{
  long val1;
  int val2;
  byte val3;
};

void setup()
{
  Serial.begin(9600);
  Serial.println(sizeof(integerData_t));
}
 



However when you then do this:
Code
Select All
const unsigned long size = sizeof(integerData_t);
 



And hover the mouse over the constant name, Intellisense claims that it is 12! But it also prints as 7.

I know that Intellisense doesn't understand all AVR Syntax, but I had assumed that in such a case it shows what the actual compiler (avr gcc) thinks. But here too it seems that Intellisense shows what the underlying VS Compiler does, which is 32 or even 64 Bit.

This isn't a huge complaint and probably not something that can be fixed, but I thought that it's interesting.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense fail with structure aligment/padding
Reply #1 - Oct 21st, 2015 at 4:34pm
Print Post  
Thanks

Yes currently Visual Micro leaves the project intellisense pointing to the Microsoft tool chain. It is slowly becoming more of a problem but gives the simplest project configuration.

  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense fail with structure aligment/padding
Reply #2 - Oct 21st, 2015 at 4:58pm
Print Post  
ps: if you see any project properties that would help with this or other intellisense settings then please let me know.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint