summaryrefslogtreecommitdiff
path: root/module/system/base
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2016-06-25 18:08:28 +0200
committerAndy Wingo <wingo@pobox.com>2016-06-25 18:08:28 +0200
commit3e719e0a35cf383d4f7fa3823494f01e244135e9 (patch)
treee77f48e5930adf590e119221540788d6c2853344 /module/system/base
parent31c76f16c6f13cf2d55c7f4830e874ed702ad777 (diff)
Add -Wmacro-use-before-definition
* module/ice-9/boot-9.scm (%auto-compilation-options): * am/guilec (GUILE_WARNINGS): Add -Wmacro-use-before-definition. * module/language/tree-il/analyze.scm (unbound-variable-analysis): Use match-lambda. (<macro-use-info>, macro-use-before-definition-analysis): New analysis. * module/system/base/message.scm (%warning-types): Add macro-use-before-definition warning type. * module/language/tree-il/compile-cps.scm (%warning-passes): Add support for macro-use-before-definition.
Diffstat (limited to 'module/system/base')
-rw-r--r--module/system/base/message.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/module/system/base/message.scm b/module/system/base/message.scm
index 26d1a181a..979291c1e 100644
--- a/module/system/base/message.scm
+++ b/module/system/base/message.scm
@@ -115,6 +115,12 @@
(emit port "~A: warning: possibly unbound variable `~A'~%"
loc name)))
+ (macro-use-before-definition
+ "report possibly mis-use of macros before they are defined"
+ ,(lambda (port loc name)
+ (emit port "~A: warning: macro `~A' used before definition~%"
+ loc name)))
+
(arity-mismatch
"report procedure arity mismatches (wrong number of arguments)"
,(lambda (port loc name certain?)