Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22031

Getting random command-line args when compiling and debugging in Visual Studio Code

$
0
0

So I'm making an example program to learn how to build and debug C projects in Visual Studio Code. For reference, here's my launch.json and tasks.json for the project:

launch.json:

"version": "0.2.0","configurations": [    {"name": "test-project","type": "cppdbg","request": "launch","program": "${workspaceFolder}\\test.exe","args": [],"stopAtEntry": false,"cwd": "${workspaceFolder}","environment": [],"externalConsole": false,"MIMode": "gdb","miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe","setupCommands": [            {"description": "Enable pretty-printing for gdb","text": "-enable-pretty-printing","ignoreFailures": true            }        ],"preLaunchTask": "build test-project"    }]

tasks.json:

"version": "2.0.0","tasks": [    {"label": "build test-project","type": "shell","command": "gcc","args": ["-std=c99","-g","${workspaceFolder}\\test.c","-o","${workspaceRoot}\\test.exe"        ],"group": {"kind": "build","isDefault": true        }    }]

And here's 'test.c':

test.c

#include <stdio.h>int main(int argc, char* argv[]){    int t = 9;    int p = 10;    return 0;}

This is what I see for my command-line arguments even though I gave no command-line arguments:

enter image description here

There turns out to be 3 extra command-line arguments "2>CON", "1>CON", and "<CON" as you can see in the watch panel. Why is this happening even though I gave 0 command-line arguments?


Viewing all articles
Browse latest Browse all 22031

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>