I just started using VSCode on a new C++ project and ran into a silly issue. Yes, I'm fully familiar with the problem described in long long int vs. long int vs. int64_t in C++, but this question is VSCode specific. The problem is simple: VSCode thinks int64_t is an alias for long long, while the compiler thinks it's an alias for long. This means, that the following code is correct according to the compiler, but not according to VSCode:
int64_t x = 20; auto y = std::max(0L, x);
For VSCode, 0L
should be 0LL
(but then it's the compiler that complains and refuses to compile the code).
How can I make VSCode agree with the compiler? I'm running VSCode on Mac but compiling code for Linux ARM64 using GCC. I'm guessing VSCode is pulling in the wrong C++ header files or something, but not sure how to point it to the right ones.