Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 BUG:VA fails to parse preprocessor #define

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
codex Posted - May 08 2020 : 3:39:17 PM
quote:
VA_X.dll file version 10.9.2332.2 Atmel built 2019.05.20
AtmelStudio
msenv.dll version 14.0.23107.0
Comctl32.dll version 6.10.7601.18837
Windows 7 6.1 Build 7601 Service Pack 1
4 processors (x86-64, WOW64)
Language info: 1252, 0x409


VA will recognize the following code just fine:
struct MyStuct
{
    struct __attribute__ ((packed))
    {
        unsigned flag1 : 1;
        unsigned flag2 : 1;
        unsigned flag3 : 1;
        unsigned flag4 : 1;
        unsigned flag5 : 1;
    };
    // Additional members to follow
};

VA fails to parse the following:
#define bitfield  struct __attribute__ ((packed))

struct MyStuct
{
    bitfield
    {
        unsigned flag1 : 1;
        unsigned flag2 : 1;
        unsigned flag3 : 1;
        unsigned flag4 : 1;
        unsigned flag5 : 1;
    };
};

3   L A T E S T    R E P L I E S    (Newest First)
accord Posted - May 10 2020 : 12:15:09 AM
The red underlines come from intellisense, and you can control them via:

Tools -> Text Editor -> C/C++ -> Advanced -> Intellisense -> Disable Squiggles

It seems that __attribute ((packed)) is a not part of standard C++. The code doesn't compile for me using VS2019, and Intellisense doesn't understand the code either.

Unfortunately, I wasn't able to find a workaround to make it work with Visual Assist, either.
codex Posted - May 09 2020 : 4:57:35 PM
In the code editor, when using the struct, the members in the bitfield struct (flag1, flag2, etc.) are underlined with the red squiggle, and reported as "Unrecognized symbol." on the hover-over tootip. Also, they do not appear in the member listbox, but "bitfield" does appear in the member listbox instead.
accord Posted - May 09 2020 : 3:57:54 PM
What problems are you seeing with this?

e.g. Do you have missing items in a member listbox? Or in Find References Results window? Or a refactoring command is broken?

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000