summaryrefslogtreecommitdiff
path: root/mcon/pl
diff options
context:
space:
mode:
authorrmanfredi <rmanfredi@2592e710-e01b-42a5-8df0-11608a6cc53d>2012-02-09 19:15:13 +0000
committerrmanfredi <rmanfredi@2592e710-e01b-42a5-8df0-11608a6cc53d>2012-02-09 19:15:13 +0000
commit8160f5523cbbb37197732ea645d02f884e180f3c (patch)
tree614060e525e21db3fe968eb823fa7ae941bff7d8 /mcon/pl
parentc1893f4bddbe65d8a7bca7e34890fd85d58bd509 (diff)
Make Assert.U explicitly claim it creates a local "static_assert.h" file.
Taught metalint to look for #include files in here-documents to catch missing dependencies on Assert, or other special units that would create such locally-defined includes. git-svn-id: svn://svn.code.sf.net/p/dist/code/trunk/dist@132 2592e710-e01b-42a5-8df0-11608a6cc53d
Diffstat (limited to 'mcon/pl')
-rw-r--r--mcon/pl/lint.pl16
1 files changed, 14 insertions, 2 deletions
diff --git a/mcon/pl/lint.pl b/mcon/pl/lint.pl
index 1e4cad3..64bb466 100644
--- a/mcon/pl/lint.pl
+++ b/mcon/pl/lint.pl
@@ -793,14 +793,26 @@ sub p_body {
$shused{$unit} .= "\$$var " unless $shused{$unit} =~ /\$$var\b/;
}
- return if $heredoc ne '' && !$began_here; # Still in here-document
+ local($file);
+
+ if ($heredoc ne '' && !$began_here) {
+ # Still in here-document
+ # Just look for included files from C programs expected to be local
+ # in case they missed the special unit that produces these files.
+ if (s!#(\s*)include(\s+)"([\w.]+)"!!) {
+ $file = $3;
+ $fileused{$unit} .= "$file " unless
+ $filetmp{$file} || $fileused{$unit} =~ /\b$file\b/;
+ }
+ return;
+ }
# Now look at private files used by the unit (./file or ..../UU/file)
# We look at things like '. ./myread' and `./loc ...` as well as "< file"
- local($file);
$_ = $line;
s/<\S+?>//g; # <header.h> would set-off our <file detection
while (
+ s!#(\s*)include(\s+)"([\w.]+)"!! ||
s!(\.\s+|`\s*)(\S*UU|\.)/([^\$/`\s;]+)\s*!! ||
s!(`\s*\$?)cat\s+(\./)?([^\$/`\s;]+)\s*`!! ||
s!(\s+)(\./)([^\$/`\s;]+)\s*!! ||