From 8cd97c4793baffc6ce2b5fe4862e742c6ebda5c2 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Fri, 19 Aug 2022 07:09:59 -0700 Subject: Updates the warnist script to report gfortran generic warnings (#2040) These are not associated with a file and line number, like specifying a non-existant include directory on the compile line. --- bin/warnhist | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bin/warnhist b/bin/warnhist index 9453b43..ff202a2 100755 --- a/bin/warnhist +++ b/bin/warnhist @@ -247,6 +247,18 @@ while (<>) { } elsif($_ =~ /^\s*[Ww]arning:.*/) { $name = $last_c_name; ($toss, $warning, $extra, $extra2) = split /\:/, $_; + # Check for file-scope gcc Fortran warning output + } elsif($_ =~ /f\d\d\d: Warning:/) { + # These are interspersed with the "compiling a file" output + # when compiling with `make -j` and thus difficult to tie to + # any particular file. They are due to things like inappropriate + # build options and don't have a line number. + # + # They start with f, as in f951 + $name = "(generic)"; + $line = int(rand(1000000)); # Hack to avoid counting as duplictates + + ($warning) = $_ =~ /\[(.*)\]/x; # Check for FORTRAN warning output } elsif($_ =~ /^Warning:.*/) { $name = $last_fort_name; -- cgit v0.12