From a22bdd20a50cc39d19866d6dc220d1f6b15c627a Mon Sep 17 00:00:00 2001 From: "Konstantin Kirik (snegovick)" Date: Thu, 4 Dec 2025 18:39:51 +0300 Subject: Rewrite anonymous structs to stop compiler complaints about multiple definitions --- utils/qa/a.h | 10 ++++++---- utils/qa/lex.c | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'utils/qa') diff --git a/utils/qa/a.h b/utils/qa/a.h index f7fce238..a0163ed5 100644 --- a/utils/qa/a.h +++ b/utils/qa/a.h @@ -55,11 +55,12 @@ struct Sym }; #define S ((Sym*)0) -struct +struct s_fi { char* p; int c; -} fi; +}; +extern struct s_fi fi; struct Io { @@ -71,11 +72,12 @@ struct Io }; #define I ((Io*)0) -struct +struct s_h { Sym* sym; short type; -} h[NSYM]; +}; +extern struct s_h h[NSYM]; struct Gen { diff --git a/utils/qa/lex.c b/utils/qa/lex.c index afa3a708..0d79cf1a 100644 --- a/utils/qa/lex.c +++ b/utils/qa/lex.c @@ -3,6 +3,9 @@ #include "y.tab.h" #include +struct s_fi fi; +struct s_h h[NSYM]; + void main(int argc, char *argv[]) { -- cgit v1.2.3