Mercurial > hg > index.cgi
changeset 559:ddc7b05a5675
Add --no-warn=ifp1 flag to suppress warnings about ifp1 and ipf2
author | William Astle <lost@l-w.ca> |
---|---|
date | Thu, 21 Sep 2023 13:13:23 -0600 |
parents | 7fb2047ccdee |
children | dba08c7dff96 |
files | lwasm/lwasm.h lwasm/main.c lwasm/pseudo.c |
diffstat | 3 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lwasm/lwasm.h Fri Sep 08 00:35:43 2023 -0600 +++ b/lwasm/lwasm.h Thu Sep 21 13:13:23 2023 -0600 @@ -225,6 +225,9 @@ W_OPERAND_SIZE = 1004 } lwasm_errorcode_t; +#define NOWARN_NONE 0 +#define NOWARN_IFP1 1 + typedef struct lwasm_error_s lwasm_error_t; struct lwasm_error_s { @@ -441,6 +444,8 @@ int fileerr; // flags error opening file int exprwidth; // the bit width of the expression being evaluated int listnofile; // nonzero to suppress printing file name in listings + + int nowarn_flags; // flags indicating which warnings to suppress }; struct symtabe *register_symbol(asmstate_t *as, line_t *cl, char *sym, lw_expr_t value, int flags);
--- a/lwasm/main.c Fri Sep 08 00:35:43 2023 -0600 +++ b/lwasm/main.c Thu Sep 21 13:13:23 2023 -0600 @@ -68,6 +68,7 @@ { "unicorns", 0x142, 0, 0, "Add sooper sekrit sauce"}, { "6800compat", 0x200, 0, 0, "Enable 6800 compatibility instructions, equivalent to --pragma=6800compat" }, { "no-output", 0x105, 0, 0, "Inhibit creation of output file" }, + { "no-warn", 0x109, "FLAG", 0, "Suppress warnings of the specified type" }, { 0 } }; @@ -261,6 +262,11 @@ as -> preprocess = 1; break; + case 0x109: + if (!strcasecmp(arg, "ifp1") || !strcasecmp(arg, "ifp2")) + as -> nowarn_flags |= NOWARN_IFP1; + break; + case 0x200: as -> pragmas |= PRAGMA_6800COMPAT; break;
--- a/lwasm/pseudo.c Fri Sep 08 00:35:43 2023 -0600 +++ b/lwasm/pseudo.c Thu Sep 21 13:13:23 2023 -0600 @@ -1111,7 +1111,8 @@ return; } - lwasm_register_error2(as, l, W_NOT_SUPPORTED, "%s", "IFP1"); + if ((as -> nowarn_flags & NOWARN_IFP1) == 0) + lwasm_register_error2(as, l, W_NOT_SUPPORTED, "%s", "IFP1"); } PARSEFUNC(pseudo_parse_ifp2) @@ -1127,7 +1128,8 @@ return; } - lwasm_register_error2(as, l, W_NOT_SUPPORTED, "%s", "IFP2"); + if ((as -> nowarn_flags & NOWARN_IFP1) == 0) + lwasm_register_error2(as, l, W_NOT_SUPPORTED, "%s", "IFP2"); } PARSEFUNC(pseudo_parse_ifeq)