Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Intellisense fail with structure aligment/padding (Read 1748 times)
Serenifly
Junior Member
**
Offline



Posts: 20
Intellisense fail with structure aligment/padding
Oct 21st, 2015 at 5:30pm
 
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:
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:
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
 
Visual Micro
Administrator
*****
Offline



Posts: 10545
United Kingdom
Re: Intellisense fail with structure aligment/padding
Reply #1 - Oct 21st, 2015 at 5:34pm
 
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
 
Visual Micro
Administrator
*****
Offline



Posts: 10545
United Kingdom
Re: Intellisense fail with structure aligment/padding
Reply #2 - Oct 21st, 2015 at 5:58pm
 
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 Topic Print