Declarations for non-existent variable and function bindings are silently ignored (except for IGNORE and IGNORABLE)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
What I do:
(locally (declare (ftype function non-existent-
(locally (declare (inline non-existent-
(locally (declare (notinline non-existent-
(locally (declare (special non-existent-
(locally (declare (type integer non-existent-
What happens:
In all these cases, no warning of any kind is signaled.
What I expected to happen:
I think a STYLE-WARNING might be appropriate in some or all of these cases.
I'm not really a "declarations expert" and there might be good reasons why no warning is signaled in these cases. In particular, I wouldn't be surprised if tons of code produce such "dead" but otherwise benign declarations. Producing such code may or may not reflect sloppy handling of declarations (and so may or may not merit a STYLE-WARNING), I'm not experienced enough to tell. Maybe eliminating such declarations is seen as too cumbersome for not enough benefit?...
SBCL version: 1.0.42
uname -a: Linux dynamorph 2.6.32-27-generic #49-Ubuntu SMP Wed Dec 1 23:52:12 UTC 2010 i686 GNU/Linux
*features*:
(:SWANK :QUICKLISP :SB-BSD-
:SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE :SB-EVAL
:SB-SOURCE-
:LARGEFILE :GENCGC :STACK-
:COMPARE-
:STACK-
:STACK-
:CYCLE-COUNTER :INLINE-CONSTANTS :MEMORY-
:OS-PROVIDES-
Changed in sbcl: | |
importance: | Undecided → Wishlist |
status: | New → Triaged |
I forgot to mention that (locally (declare (ignore non-existent- variable) )) (and ignorable) exhibit exactly the behavior I'd expect:
"STYLE-WARNING: declaring unknown variable NON-EXISTENT- VARIABLE to be ignored"