From 8c92d5c5083ff2b6489dac40fc4dc0a826c6fb4b Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 2 Aug 2021 22:53:40 +0200 Subject: [PATCH] Show warnings if something looks wrong This makes no difference to the output. Signed-off-by: Gilles Peskine --- scripts/generate_errors.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/generate_errors.pl b/scripts/generate_errors.pl index 02a7cb8b7..65383fa3c 100755 --- a/scripts/generate_errors.pl +++ b/scripts/generate_errors.pl @@ -21,6 +21,7 @@ # limitations under the License. use strict; +use warnings; my ($include_dir, $data_dir, $error_file); @@ -84,7 +85,7 @@ foreach my $file (@files) { # Discard Doxygen comments that are coincidentally present before # an error definition but not attached to it. This is ad hoc, based # on what actually matters (or mattered at some point). - undef $before if $before =~ /\s*\\name\s/s; + undef $before if defined($before) && $before =~ /\s*\\name\s/s; die "Description neither before nor after $name in $file\n" if !defined($before) && !defined($after); die "Description both before and after $name in $file\n"