Need clearer error for malformed (declare (ignore))
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
version: SBCL 1.0.55
uname: Linux naryl-workstation 3.2.7-pf #6 SMP PREEMPT Wed May 2 16:06:23 MSK 2012 x86_64 Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz GenuineIntel GNU/Linux
features: (:OSICAT-FD-STREAMS CFFI-FEATURES:
CFFI-FEATURES:UNIX :CFFI CFFI-SYS:
:SB-BSD-
:SB-DOC :SB-PACKAGE-LOCKS :SB-UNICODE :SB-EVAL :SB-SOURCE-
:IEEE-
:OS-PROVIDES-
:OS-PROVIDES-
:MEMORY-
:CYCLE-COUNTER :ALIEN-CALLBACKS :STACK-
:STACK-
:STACK-
:UNWIND-
:C-STACK-
:SB-FUTEX :SB-THREAD :LINUX :ELF :UNIX :X86-64)
Trying to compile "(defun test (a) (declare (ignore (a))) nil)" results in the following error message:
#<THREAD "initial thread" RUNNING {1002998E83}>:
error while parsing arguments to DESTRUCTURING-BIND:
invalid number of elements in
(A)
to satisfy lambda list
(SB-C::WOT SB-C::FN-NAME):
exactly 2 expected, but 1 found
With backtrace deep inside IR1. In case the user just wrote an extra pair of parentheses around the var the message is a bit misleading.
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
commit 01cc9978e742a5e 3a7882e397b0185 7bed774501
Author: Stas Boukarev <email address hidden>
Date: Wed May 16 19:04:21 2012 +0400
Better error message for malformed IGNORE declarations.
Give better errors for things like (ignore (a)) and
(ignore (function . b)).