diff --git a/driver/iverilog.man b/driver/iverilog.man index e71013bab..2d8a253c8 100644 --- a/driver/iverilog.man +++ b/driver/iverilog.man @@ -135,9 +135,9 @@ they will be used as root modules instead. .B -T\fImin|typ|max\fP Use this switch to select min, typ or max times from min:typ:max expressions. Normally, the compiler will simply use the typ value from -these expressions (with a warning) but this switch will tell the -compiler explicitly which value to use. This will suppress the -warning that the compiler is making a choice. +these expressions (printing a warning for the first ten it finds) but +this switch will tell the compiler explicitly which value to use. This +will suppress the warning that the compiler is making a choice. .TP 8 .B -t\fItarget\fP Use this switch to specify the target output format. See the diff --git a/parse.y b/parse.y index dfd6f39e5..c2614ce86 100644 --- a/parse.y +++ b/parse.y @@ -977,6 +977,22 @@ expr_mintypmax $$ = $5; break; } + if (min_typ_max_warn > 0) { + cerr << $$->get_line() << ": warning: choosing "; + switch (min_typ_max_flag) { + case MIN: + cerr << "min"; + break; + case TYP: + cerr << "typ"; + break; + case MAX: + cerr << "max"; + break; + } + cerr << " expression." << endl; + min_typ_max_warn -= 1; + } } ; @@ -2840,6 +2856,22 @@ specparam tmp = $7; break; } + if (min_typ_max_warn > 0) { + cerr << tmp->get_line() << ": warning: choosing "; + switch (min_typ_max_flag) { + case MIN: + cerr << "min"; + break; + case TYP: + cerr << "typ"; + break; + case MAX: + cerr << "max"; + break; + } + cerr << " expression." << endl; + min_typ_max_warn -= 1; + } pform_set_specparam(lex_strings.make($1), tmp); delete $1; }