Skip to content

Commit 2a733de

Browse files
committed
Adds includes to suppress incorrect warn
1 parent f21db32 commit 2a733de

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

example.ssa

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
function w $strlen(w %str) {
2+
%t3 =w copy 0
3+
%i =w copy %t3
4+
@L_begin_0
5+
%t4 =w copy 1
6+
%t5 =w mul %i, %t4
7+
%t6 =w add %str, %t5
8+
%t7 =b loadb %t6
9+
jnz %t7, @L_then_0, @L_0
10+
@L_then_0
11+
%t8 =w copy 1
12+
%i =w add %i, %t8
13+
%t9 =w copy -1
14+
%t10 =w add %i, %t9
15+
@L_1
16+
jmp @L_begin_0
17+
@L_0
18+
ret %i
19+
}

src/lexer_qbesil.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
#pragma once
12
#include <stdbool.h>
23
#include <stdio.h>
34
#include <stdlib.h>
45
#include <string.h>
56

7+
#include "defs.h"
8+
#include "globals.c"
9+
610
typedef enum {
711
QS_TOK_EOF,
812
/* punctuation */

src/parser_c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ void read_full_var_decl(var_t *vd, int anon, int is_param)
709709
type_t *type = find_type(type_name, find_type_flag);
710710

711711
if (!type) {
712-
printf("Could find type %s%s\n", find_type_flag == 2 ? "struct " : "",
712+
printf("Could not find type %s%s\n", find_type_flag == 2 ? "struct " : "",
713713
type_name);
714714
abort();
715715
}

src/parser_qbesil.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include <stdlib.h>
44
#include <string.h>
55

6+
#include "lexer_qbesil.c"
7+
68
/*
79
* generic dynamic array implementation supporting multiple data types with
810
* arena-based memory management.

0 commit comments

Comments
 (0)