Steel Bank Common Lisp

Need clearer error for malformed (declare (ignore))

Reported by naryl on 2012-05-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
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:FLAT-NAMESPACE CFFI-FEATURES:X86-64
 CFFI-FEATURES:UNIX :CFFI CFFI-SYS::FLAT-NAMESPACE :QUICKLISP
 :SB-BSD-SOCKETS-ADDRINFO :ASDF2 :ASDF :ASDF-UNIX :ANSI-CL :COMMON-LISP :SBCL
 :SB-DOC :SB-PACKAGE-LOCKS :SB-UNICODE :SB-EVAL :SB-SOURCE-LOCATIONS
 :IEEE-FLOATING-POINT :OS-PROVIDES-POLL :OS-PROVIDES-GETPROTOBY-R
 :OS-PROVIDES-SUSECONDS-T :OS-PROVIDES-BLKSIZE-T :OS-PROVIDES-PUTWC
 :OS-PROVIDES-DLADDR :OS-PROVIDES-DLOPEN :LITTLE-ENDIAN :MULTIPLY-HIGH-VOPS
 :MEMORY-BARRIER-VOPS :INLINE-CONSTANTS :FLOAT-EQL-VOPS :COMPLEX-FLOAT-VOPS
 :CYCLE-COUNTER :ALIEN-CALLBACKS :STACK-ALLOCATABLE-FIXED-OBJECTS
 :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-VECTORS
 :STACK-ALLOCATABLE-CLOSURES :RAW-INSTANCE-INIT-VOPS
 :UNWIND-TO-FRAME-AND-CALL-VOP :COMPARE-AND-SWAP-VOPS :LINKAGE-TABLE
 :C-STACK-IS-CONTROL-STACK :STACK-GROWS-DOWNWARD-NOT-UPWARD :GENCGC :LARGEFILE
 :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.

Stas Boukarev (stassats) wrote :

commit 01cc9978e742a5e3a7882e397b01857bed774501
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)).

Changed in sbcl:
status: New → Fix Committed
Stas Boukarev (stassats) on 2012-05-21
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers