diff options
Diffstat (limited to 'mcon/pl/lint.pl')
-rw-r--r-- | mcon/pl/lint.pl | 23 |
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) { |