Skip to content

Commit 3df370a

Browse files
authored
Update test.c.qcc
1 parent cbb5423 commit 3df370a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

c/cert/test/rules/FIO38-C/test.c.qcc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
#include <stdio.h>
2+
// Workaround for the Musl implementing FILE as an incomplete type.
3+
#if !defined(__DEFINED_struct__IO_FILE)
4+
struct _IO_FILE {
5+
char __x;
6+
};
7+
#define __DEFINED_struct__IO_FILE
8+
#endif
29

310
int f1(void) {
411
FILE my_stdout = *stdout; // NON_COMPLIANT
@@ -13,7 +20,7 @@ int f2(void) {
1320
}
1421
int f2b(void) {
1522
FILE *const *my_stdout;
16-
my_stdout = &stdout; // COMPLIANT
23+
// my_stdout = &stdout; // does not compile in qcc
1724
FILE my_stdout2 = **my_stdout; // NON_COMPLIANT
1825
return fputs("Hello, World!\n", *my_stdout);
1926
}

0 commit comments

Comments
 (0)