# HG changeset patch # User William Astle # Date 1695323603 21600 # Node ID ddc7b05a5675e7e5ce136f8fe7405f8a08861885 # Parent 7fb2047ccdee1dbe81fcea0aa23f587da37778e3 Add --no-warn=ifp1 flag to suppress warnings about ifp1 and ipf2 diff -r 7fb2047ccdee -r ddc7b05a5675 lwasm/lwasm.h --- 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); diff -r 7fb2047ccdee -r ddc7b05a5675 lwasm/main.c --- 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; diff -r 7fb2047ccdee -r ddc7b05a5675 lwasm/pseudo.c --- 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)