阅读背景:

vs code error: 'for' loop initial declarations are only allowed in C99 mode 的原因及解决办法_yyzz990的博客

来源:互联网 

在task.json 的 args 里加上 -std=c99

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558 
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "label": "gcc build active file",
            "command": "/usr/bin/gcc",
            "args": [
                "-std=c99",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "/usr/bin",
                
            },
            "problemMatcher": [
                "$gcc"
            ]
        }
    ]
}{
    // See h



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: