Skip to content

Draft: Add with-compilation-unit*

Eric Timmons requested to merge simplify-deferred-warnings into master

A macro that expands to a standard with-compilation-unit, wrapped in a condition handler. The condition handler takes all warnings signaled upon exit of the wrapped w-c-u, collects them in a deferred-warnings-error condition and signals it with error.

This behavior can be controlled using the :asdf-deferred-warnings-behavior option to with-compilation-unit*, which defaults to the value of *with-compilation-unit-deferred-warnings-behavior*, which itself defaults to :error.

This was inspired by the discussion in #80 (closed) and sidesteps the issue brought up by #82.

This solution is not as nifty as the current deferred warning support, but is very simple and should work on any implementation that supports deferred warnings. Notably, we lose the ability to map deferred warnings to the file that produced them (although that could probably be fixed with some implementation specific code) and this will not nicely transfer to using separate processes to compile.

Some implementations do not support deferred warnings at all, and some support deferring them but do not resignal upon exit of the compilation unit. I'm going to document what I discover in this table below. It affects ASDF only through our tests.

impl resignals undefined vars resignals undefined functions
abcl no support no, only prints
ccl no support yes
cmucl yes yes?
ecl no support (w-c-u => progn) no support (w-c-u => progn)
sbcl yes yes
Edited by Eric Timmons

Merge request reports