0
#define BIT(n) ( 1<<(n) )
#define A BIT(0)

void main(void)
{
    if(A == 0)
    {
    }
}

I want to see the definition of A, vs code will jump to #define BIT(n) ( 1<<(n) ) I hope vs code jump to #define A BIT(0) there are any way to achive that?

zhangqi
  • 3
  • 1
  • The statements which starts from `#` preprocessor process them & preprocessor runs before compiler. So it will replace `A` with `BIT(0)` & then `BIT(0)` with `(1<<(0))` . Then code will compile & run when you execute. – Abhishek Mane Mar 18 '22 at 14:12
  • Also If you are using proper IDE it should give error as `void main()` is prohibited by the C++ standard https://stackoverflow.com/a/204483/11862989 – Abhishek Mane Mar 19 '22 at 07:03
  • Actually i just want to know there are any way to change my vs code behavior. Just jump to the **A**'s statement, not **BIT(n)**'s statement. – zhangqi Mar 25 '22 at 12:57
  • No I don't know about that. – Abhishek Mane Mar 26 '22 at 04:02

1 Answers1

0

This is a known bug in the C/C++ extension, which (seems like) will be fixed in the upcoming release 1.10

Nova
  • 321
  • 9
  • 20