C · 655 bytes Raw Blame History
1 /**
2 * Test file for LSP diagnostics display
3 * This file contains intentional errors to test diagnostic markers
4 */
5
6 #include <stdio.h>
7
8 int main() {
9 // Error: Missing semicolon
10 int x = 5
11
12 // Error: Undefined variable 'y'
13 printf("Value: %d\n", y);
14
15 // Warning: Type mismatch
16 int z = "hello";
17
18 // Warning: Unused variable
19 int unused_var = 10;
20
21 // Error: Wrong number of arguments
22 printf();
23
24 // Warning: Missing return in function returning int
25 if (x > 0) {
26 return 0;
27 }
28 // Missing return for else case
29 }
30
31 // Function with missing parameter type
32 void test_func(param) {
33 printf("Test\n");
34 }