From 53f698feb9ee4dcf366301b0000b2028b9ebffa5 Mon Sep 17 00:00:00 2001 From: Ondrej Ille Date: Sun, 18 Jun 2023 19:12:15 +0200 Subject: [PATCH] src: Use pedantic_diag to throw error that can be demoted to warning. --- src/sem.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/sem.c b/src/sem.c index f8018d01..75ee7b0e 100644 --- a/src/sem.c +++ b/src/sem.c @@ -1469,9 +1469,6 @@ static bool sem_compare_interfaces(tree_t dport, tree_t bport, tree_flags_t dflags = tree_flags(dport); tree_flags_t bflags = tree_flags(bport); - diag_level_t nexp_match_elevel = opt_get_int(OPT_RELAXED) ? - DIAG_WARN : DIAG_ERROR; - ident_t dname = tree_ident(dport); ident_t bname = tree_ident(bport); @@ -1525,7 +1522,7 @@ static bool sem_compare_interfaces(tree_t dport, tree_t bport, bool dmode_explicit = !!(dflags & TREE_F_EXPLICIT_MODE); if (bmode_explicit != dmode_explicit) { - diag_t *d = diag_new(nexp_match_elevel, tree_loc(bport)); + diag_t *d = pedantic_diag(bport); diag_printf(d, "mode (%s) of %s %s of subprogram %s not defined " "equally in subprogram specification and " "subprogram body", port_mode_str(dmode), what, @@ -1543,7 +1540,7 @@ static bool sem_compare_interfaces(tree_t dport, tree_t bport, const class_t bclass = tree_class(bport); if (dclass != bclass) { - diag_t *d = diag_new(nexp_match_elevel, tree_loc(bport)); + diag_t *d = diag_new(DIAG_ERROR, tree_loc(bport)); diag_printf(d, "class %s of subprogram body %s %s %s does not " "match class %s in specification", class_str(bclass), istr(tree_ident(body)), what, istr(dname), class_str(dclass)); @@ -1559,7 +1556,7 @@ static bool sem_compare_interfaces(tree_t dport, tree_t bport, bool dclass_explicit = !!(dflags & TREE_F_EXPLICIT_CLASS); if (bclass_explicit != dclass_explicit) { - diag_t *d = diag_new(nexp_match_elevel, tree_loc(bport)); + diag_t *d = pedantic_diag(bport); diag_printf(d, "class (%s) of %s %s of subprogram %s not defined " "equally in subprogram specification and " "subprogram body", class_str(dclass), what, -- 2.39.2