1

I am wondering how I could configure the Code Runner extension on VS Code (MacOS 10.15) to display warnings (i.e. -Wall?)

Would there be a simple, almost permanent method so code runner will always display warnings no matter which CPP file I build?

starball
  • 20,030
  • 7
  • 43
  • 238
irahorecka
  • 1,447
  • 8
  • 25

1 Answers1

2

Yes! This is possible.

Go to the Workspace Settings, search for code runner and click on Executor Map:

Workspace Settings for Executor Map

You may then use the following JSON code:

{
    "code-runner.executorMap": {
       // ...
        "c": "cd $dir && gcc $fileName -Wall -o $fileNameWithoutExt && $dir$fileNameWithoutExt"
    }    // used -Wall here
}

Save it and quit from the file and jump to the code you want to run. Press Ctrl+Alt+J to select the run type. Select C simply and you're good to go.

Rohan Bari
  • 7,482
  • 3
  • 14
  • 34