mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-16 08:40:19 +02:00
Add `-Wunused-toplevel' compiler warning.
* module/language/tree-il/analyze.scm (<reference-dag>): New record type. (dag-reachable-nodes, dag-reachable-nodes*, unused-variable-analysis): New variables. (unbound-variable-analysis): Slightly simplify the `up' procedure. * module/language/tree-il/compile-glil.scm (%warning-passes): Add `unused-toplevel'. * module/system/base/message.scm (%warning-types): Likewise. * test-suite/tests/tree-il.test (%opts-w-unused-toplevel): New variable. ("warnings")["unused-toplevel"]: New test prefix.
This commit is contained in:
parent
7cd554943b
commit
bcae9a98b0
4 changed files with 261 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
|||
;;; User interface messages
|
||||
|
||||
;; Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
|
||||
|
||||
;;; This library is free software; you can redistribute it and/or
|
||||
;;; modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -81,6 +81,12 @@
|
|||
(format port "~A: warning: unused variable `~A'~%"
|
||||
loc name)))
|
||||
|
||||
(unused-toplevel
|
||||
"report unused local top-level variables"
|
||||
,(lambda (port loc name)
|
||||
(format port "~A: warning: possibly unused local top-level variable `~A'~%"
|
||||
loc name)))
|
||||
|
||||
(unbound-variable
|
||||
"report possibly unbound variables"
|
||||
,(lambda (port loc name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue