summaryrefslogtreecommitdiff
path: root/mcon/pl
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2020-05-19 21:29:57 -0700
committerManoj Srivastava <srivasta@debian.org>2020-05-19 21:29:57 -0700
commit11948971f110800dc35b4f6fec90cc01bebd6a7e (patch)
treed69e6f034efc4ace4c2d573a50153b7a875915f1 /mcon/pl
parent7c4aad4e01c8278e073d28a5c1f59b12582431c1 (diff)
parent50ca5b27f2f7c51d062b3a89d334f7243f467078 (diff)
Diffstat (limited to 'mcon/pl')
-rw-r--r--mcon/pl/lint.pl23
1 files changed, 20 insertions, 3 deletions
diff --git a/mcon/pl/lint.pl b/mcon/pl/lint.pl
index 0120c51..e73f0fd 100644
--- a/mcon/pl/lint.pl
+++ b/mcon/pl/lint.pl
@@ -78,6 +78,7 @@ sub init_extraction {
%filetmp = (); # Local temporary files in ?F: directives
%filesetin = (); # Lists units defining a temporary file
%filecreated = (); # Records files created in this unit
+ %filedefined = (); # Records units that export a given file
%prodfile = (); # Unit where a given file is said to be created
%defseen = (); # Symbol defintions claimed
%lintset = (); # Symbols declared set by a ?LINT: line
@@ -622,15 +623,30 @@ sub p_file {
}
$prodfile{$file} .= "$unit " if $fileseen{$file} == 1;
($uufile = $file) =~ s|^\./(\S+)$|$1|;
- next if $file eq $uufile; # Don't care about non-UU files
+ if ($file eq $uufile) {
+ # This is a non-UU files created and not a temporary file
+ # It is meant to be exported by Configure
+ if (exists $filedefined{$file}) {
+ my $other = $filedefined{$file};
+ warn "$where: file '$file' already exported by $other.U.\n";
+ } else {
+ $filedefined{$file} = $unit;
+ }
+ next;
+ }
unless ($is_special || $lintcreated{$uufile}) {
warn "$where: UU file '$uufile' in non-special unit ignored.\n";
delete $lintcreated{$uufile}; # Detect spurious LINT
next;
}
delete $lintcreated{$uufile} if !$is_special; # Detect spurious LINT
- $filemaster{$uufile} = $unit unless defined $filemaster{$uufile};
- $filecreated{$uufile} = 'a'; # Will be automagically incremented
+ if (exists $filemaster{$uufile}) {
+ my $other = $filemaster{$uufile};
+ warn "$where: UU file '$uufile' already created by $other.U.\n";
+ } else {
+ $filemaster{$uufile} = $unit;
+ $filecreated{$uufile} = 'a'; # Will be automagically incremented
+ }
}
}
@@ -1308,6 +1324,7 @@ sub sanity_checks {
undef %shspecial;
undef %shvisible;
undef %filemaster;
+ undef %filedefined;
# Spot multiply defined C symbols
foreach $sym (keys %cmaster) {