[PATCH 0/3] Add '-Wunused-module'

2023-02-11 Thread Ludovic Courtès
Hello Guilers! Following a discussion started at the Guix Days and continued online¹, it seems we could benefit from a compiler warning for unused modules, and this is what this patch does. The new ‘-Wunused-module’ warning is enabled at ‘-W2’ only. The main reason for not enabling it at ‘-W1’ i

[PATCH 3/3] Remove unnecessary module imports.

2023-02-11 Thread Ludovic Courtès
These were found with: make GUILE_WARNINGS='-W1 -Wunused-module' * module/ice-9/copy-tree.scm: * module/ice-9/eval-string.scm: * module/ice-9/getopt-long.scm: * module/ice-9/poll.scm: * module/ice-9/popen.scm: * module/ice-9/sandbox.scm: * module/ice-9/threads.scm: * module/sxml/apply-templates

[PATCH 1/3] Add -Wunused-module.

2023-02-11 Thread Ludovic Courtès
* module/language/tree-il/analyze.scm (): New record type. (unused-module-analysis): New variable. (make-unused-module-analysis): New analysis. (make-analyzer): Add it. * module/system/base/message.scm (%warning-types): Add 'unused-module'. * test-suite/tests/tree-il.test (%opts-w-unused-module): N

[PATCH 2/3] Add 'record-case' to '.dir-locals.el'.

2023-02-11 Thread Ludovic Courtès
* module/language/tree-il/fix-letrec.scm (fix-letrec): Remove "Local Variables" bit. * .dir-locals.el (scheme-mode): Add 'record-case'. --- .dir-locals.el | 1 + module/language/tree-il/fix-letrec.scm | 4 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.