与代码中GCC C的错误语法突出显示
自从我在计算机上下载Visual Studio以来,语法突出显示和Intellisense在我的C程序中的VS代码中都是错误的。例如,此代码
int main()
{
unsigned long long size = 3;
int a[size];
return 0;
}
具有size
在方括号中以红色下划线的变量。其他事情也似乎也没有。例如,__ uint128_t
用于在Intellisense建议中显示的类型,但现在没有。另外,为了在< math.h>
标题文件中包含定义,我需要包括#define _use_math_defines
现在,否则,否则VS代码将无法识别任何一个宏。
上面列出的所有代码对我来说仍然很好,但是错误的语法突出显示可能会有些烦人。我的理论是,VS代码编辑器认为我正在使用MSVC编译器而不是GCC。我的没有Visual Studio的朋友没有这些问题。我想不出任何其他原因。
有什么方法可以解决此问题,例如在设置中更改编译器选项?谢谢。
Ever since I downloaded Visual Studio on my computer, syntax highlighting and IntelliSense has been erroneous in VS Code for my C programs. For example, this code
int main()
{
unsigned long long size = 3;
int a[size];
return 0;
}
has the size
variable underlined in red in the square brackets. Other things seem off, too. For example, the __uint128_t
type used to show up in the IntelliSense recommendations, but now it does not. Also, in order to include definitions from the <math.h>
header file, I need to include #define _USE_MATH_DEFINES
now, otherwise VS Code will not recognize any of the macros.
All of the code listed above still compiles just fine for me, but the erroneous syntax highlighting can get a bit annoying. My theory is that the VS Code editor thinks that I am using an MSVC compiler instead of GCC. My friend who doesn't have Visual Studio has none of these problems. I can't think of any other reason for why this is happening.
Is there a way that I can fix this, like maybe changing the compiler options in settings? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论