aboutsummaryrefslogtreecommitdiffstats
path: root/asm/warnings.pl
diff options
context:
space:
mode:
Diffstat (limited to 'asm/warnings.pl')
-rwxr-xr-xasm/warnings.pl74
1 files changed, 35 insertions, 39 deletions
diff --git a/asm/warnings.pl b/asm/warnings.pl
index ba4f5906..7987ab4c 100755
--- a/asm/warnings.pl
+++ b/asm/warnings.pl
@@ -64,47 +64,46 @@ sub find_warnings {
# End block comment
$in_comment = 0;
undef $this;
- } elsif ($l =~ /^\s*\/?\*\!(\s*)(.*?)\s*$/) {
- my $ws = $1;
+ } elsif ($l =~ /^\s*\/?\*\!(\-|\=|\s*)(.*?)\s*$/) {
+ my $opr = $1;
my $str = $2;
- next if ($str eq '');
-
- if (!defined($this) || ($ws eq '' && $str ne '')) {
- if ($str =~ /^([\w-]+)\s+\[(\w+)\]\s(.*\S)\s*$/) {
- my $name = $1;
- my $def = $2;
- my $help = $3;
-
- my $cname = uc($name);
- $cname =~ s/[^A-Z0-9_]+/_/g;
-
- $this = {name => $name, cname => $cname,
- def => $def, help => $help,
- doc => [], file => $infile, line => $nline};
-
- if (defined(my $that = $aliases{$name})) {
- # Duplicate defintion?!
- printf STDERR "%s:%s: warning %s previously defined at %s:%s\n",
- $infile, $nline, $name, $that->{file}, $that->{line};
- } else {
- push(@warnings, $this);
- # Every warning name is also a valid warning alias
- add_alias($name, $this);
- $nwarn++;
- }
- } elsif (defined($this) && $str =~ /^\=([-\w,]+)\s*$/) {
- # Alias names for warnings
- for my $a (split(/,+/, $1)) {
- add_alias($a, $this);
- }
+ if ($opr eq '' && $str eq '') {
+ next;
+ } elsif ((!defined($this) || ($opr eq '')) &&
+ ($str =~ /^([\w\-]+)\s+\[(\w+)\]\s(.*\S)\s*$/)) {
+ my $name = $1;
+ my $def = $2;
+ my $help = $3;
+
+ my $cname = uc($name);
+ $cname =~ s/[^A-Z0-9_]+/_/g;
+
+ $this = {name => $name, cname => $cname,
+ def => $def, help => $help,
+ doc => [], file => $infile, line => $nline};
+
+ if (defined(my $that = $aliases{$name})) {
+ # Duplicate defintion?!
+ printf STDERR "%s:%s: warning %s previously defined at %s:%s\n",
+ $infile, $nline, $name, $that->{file}, $that->{line};
} else {
- print STDERR "$infile:$nline: malformed warning definition\n";
- print STDERR " $l\n";
- $err++;
+ push(@warnings, $this);
+ # Every warning name is also a valid warning alias
+ add_alias($name, $this);
+ $nwarn++;
}
- } else {
+ } elsif ($opr eq '=') {
+ # Alias names for warnings
+ for my $a (split(/,+/, $1)) {
+ add_alias($a, $this);
+ }
+ } elsif ($opr =~ /^[\-\s]/) {
push(@{$this->{doc}}, "$str\n");
+ } else {
+ print STDERR "$infile:$nline: malformed warning definition\n";
+ print STDERR " $l\n";
+ $err++;
}
} else {
undef $this;
@@ -255,9 +254,6 @@ if ($what eq 'c') {
my $docdef = $whatdef{$warn->{def}};
@doc = @{$warn->{doc}};
- shift @doc while ($doc[0] =~ /^\s*$/);
- pop @doc while ($doc[$#doc] =~ /^\s*$/);
-
if (defined($docdef)) {
push(@doc, "$docdef by default.\n");
}