microsoft / microsoft/vscode-cpptools
VS Code showing error lines for parameter forward declaration syntax
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Environment
- OS and version: Ubuntu 22.10
- VS Code: 1.76.1
- C/C++ extension: v1.14.4
- OS and version of remote machine (if applicable):
- GDB / LLDB version:
Bug Summary and Steps to Reproduce
Bug Summary:
Parameter forward declaration is not supported in C99, but it is supported in modern C. Compiler is not throwing any error, but VS Code shows me error squiggles.
Steps to reproduce:
- In Ubuntu 22.10, VS Code 1.76.1, with C/C++ extension v1.14.4

- write this code
#include <stdio.h>
void display(int l; int arr[l], int l) {
printf("[ ");
for (int i = 0; i < l; i++) {
printf("%d ", arr[i]);
}
printf(" ]\n");
}
void insertionSort(int l; int arr[l], int l) {
for (int i = 1; i < l; i++) {
int curr = arr[i];
int j = i - 1;
while (j >= 0 && arr[j] > curr) {
arr[j + 1] = arr[j];
j--;
}
arr[j + 1] = curr;
}
}
int main() {
int arr[10] = {2, 5, 1, 4, 9, 8, 3, 10, 11, 7};
display(arr, 10);
insertionSort(arr, 10);
display(arr, 10);
}
- See error red lines shown by vs code

But compiling with gcc -Wall program.c shows no error, and program works as expected.
Debugger Configurations
I am not using debugger
Debugger Logs
debugger not used
Other Extensions
No response
Additional Information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the diagnostics in VS Code 1.76.1 with C/C++ extension v1.14.4 using the example in program.c, then compare the result with gcc -Wall. Done means valid parameter forward declaration syntax no longer receives erroneous red squiggles while genuine errors remain reported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, vscode
- Domain
- compilers, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100