summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f2f72a3)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
input files (including Final.sd.mk).
&:local+global [&]VARIABLE ...
input files (including Final.sd.mk).
&:local+global [&]VARIABLE ...
- Suppresses the warning about seeing both VARIABLE and
- &VARIABLE. Any & specified in the RHS is redundant: this
- always affects both versions identically.
+ Suppresses any warnings relating to forthcoming mentions
+ to VARIABLE or &VARIABLE, as applicable. Scope ends at
+ the end of the current directory's Suffix.sd.mk.
&:changequote NEWQUOTE
changes the escape sequence from & to literally NEWQUOTE
&:changequote NEWQUOTE
changes the escape sequence from & to literally NEWQUOTE
our ($dir_prefix, $dir_suffix, $dir_name,
$var_prefix, $var_prefix_name);
our ($dir_prefix, $dir_suffix, $dir_name,
$var_prefix, $var_prefix_name);
# accurate, since it is only going to be used for advice to the user.
my $note_varref = sub {
my ($vn,$amp) = @_;
# accurate, since it is only going to be used for advice to the user.
my $note_varref = sub {
my ($vn,$amp) = @_;
+ return if $varref_exp{$vn}{$amp};
$varref{$vn}{$amp}{"$f:$."} = 1;
};
$varref{$vn}{$amp}{"$f:$."} = 1;
};
next;
} elsif (s#^\s*$esc\:local\+global\s+(\S.*)$##) {
foreach my $vn (split /\s+/, $1) {
next;
} elsif (s#^\s*$esc\:local\+global\s+(\S.*)$##) {
foreach my $vn (split /\s+/, $1) {
- $vn =~ s{^$esc}{};
- $varref{$vn}{NoWarn} = 1;
+ my $amp = $vn =~ s{^$esc}{};
+ $varref_exp{$vn}{!!$amp} = 1;
}
next;
} elsif (s#^\s*$esc\:(?=(-?)include|macro)##) {
}
next;
} elsif (s#^\s*$esc\:(?=(-?)include|macro)##) {
#use Data::Dumper;
#print STDERR Dumper(\@_);
#use Data::Dumper;
#print STDERR Dumper(\@_);
my $dir_prefix = dir_prefix($path);
# ^ this is the only var which we need before we come back from
# the recursion.
my $dir_prefix = dir_prefix($path);
# ^ this is the only var which we need before we come back from
# the recursion.
foreach my $vn (sort keys %varref) {
my $vv = $varref{$vn};
next unless $vv->{''} && $vv->{1};
foreach my $vn (sort keys %varref) {
my $vv = $varref{$vn};
next unless $vv->{''} && $vv->{1};
wrncore 'local+global', "saw both $vn and &$vn" or return;
foreach my $amp ('', 1) {
printf STDERR " saw %s%s at %s\n",
wrncore 'local+global', "saw both $vn and &$vn" or return;
foreach my $amp ('', 1) {
printf STDERR " saw %s%s at %s\n",
subdirmk: warning (local+global): saw both WARN and &WARN
saw WARN at ./Dir.sd.mk:6
saw WARN at ./Dir.sd.mk:9
subdirmk: warning (local+global): saw both WARN and &WARN
saw WARN at ./Dir.sd.mk:6
saw WARN at ./Dir.sd.mk:9
+ saw WARN at ./sub/dir/Dir.sd.mk:16
+ saw WARN at ./sub/dir/Dir.sd.mk:19
saw &WARN at ./Dir.sd.mk:7
saw &WARN at ./Dir.sd.mk:10
saw &WARN at ./Dir.sd.mk:11
saw &WARN at ./Dir.sd.mk:7
saw &WARN at ./Dir.sd.mk:10
saw &WARN at ./Dir.sd.mk:11
+ saw &WARN at ./sub/dir/Dir.sd.mk:15
subdirmk: warning (unknown-warning): ./sub/dir/Dir.sd.mk:3: attempt to suppress unknown warning(s) `some-unknown-warning'
subdirmk: warning (unknown-warning): ./sub/dir/Dir.sd.mk:3: attempt to suppress unknown warning(s) `some-unknown-warning'
+sub_dir_WARN += 4
+WARN += 4
+sub_dir_WARN += 5 # this warning suppressed, precisely
+WARN += 5
+
# doctests:
# Suffix in sub/dir
# doctests:
# Suffix in sub/dir
+&WARN += 4
+WARN += 4
+&:local+global &WARN
+&WARN += 5 # this warning suppressed, precisely
+WARN += 5
+
# doctests:
&:include &doctests.sd.mk
# doctests:
&:include &doctests.sd.mk