Visual Studio display correct sizeof() for target device

86 Views Asked by At

I am working on a project for Arduino using VS2017 IDE along with Visual Micro. Everything works fine except for annoying errors caused by incorrect sizeof values being displayed in tooltips, presumably due to how Intellisense is (mis)configured.

For example, mousing over sizeof(uint16_t) displays a value of 4, which is wrong by definition. Or even more annoying problem, the following line:

//typedefd as 'typedef uint8_t byte;' in Arduino.h
CASSERT(sizeof(byte) == 1) //IDE is convinced it's == 4, though it's ok for compiler

would cause an error appear in the Error List tab (before compilation). The compiler itself does not complain. It is able to determine all sizeofs correctly - after compiling the Error List tab is free of similar errors.

Is there a way how to configure VS to adhere the target device type sizes in tooltips for the project?

0

There are 0 best solutions below