DEFGENERIC should issue a WARNING when an unknown declaration identifier is used within its DECLARE option

Bug #894202 reported by Jean-Philippe Paradis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Low
Unassigned

Bug Description

What I do and what happens:
(defgeneric foo ()
  (declare (fake-declaration)))
=> #<COMMON-LISP:STANDARD-GENERIC-FUNCTION FOO (0)>

What I expected to happen:
A warning getting thrown.

Analysis:
From CLHS DEFGENERIC:
"If an implementation notices a declaration specifier that it does not support and that has not been proclaimed as a non-standard declaration identifier name in a declaration proclamation, it should issue a warning."

A warning is already appropriately signaled in similar situations:

(declaim (fake-declaration))
--| WARNING: unrecognized declaration (FAKE-DECLARATION)

(lambda ()
  (declare (fake-declaration)))
; in: LAMBDA ()
; (PHASED-GENERIC-FUNCTIONS::FAKE-DECLARATION)
;
; caught WARNING:
; unrecognized declaration (FAKE-DECLARATION)
;
; compilation unit finished
; caught 1 WARNING condition

SBCL version: 1.0.51
uname -a: Linux dynamorph 2.6.32-35-generic #78-Ubuntu SMP Tue Oct 11 15:27:15 UTC 2011 i686 GNU/Linux

*features*:
(:SWANK :QUICKLISP :SB-BSD-SOCKETS-ADDRINFO :ASDF2 :ASDF :ASDF-UNIX :ANSI-CL
 :COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE
 :SB-EVAL :SB-SOURCE-LOCATIONS :IEEE-FLOATING-POINT :X86 :UNIX :ELF :LINUX
 :SB-THREAD :LARGEFILE :GENCGC :STACK-GROWS-DOWNWARD-NOT-UPWARD
 :C-STACK-IS-CONTROL-STACK :COMPARE-AND-SWAP-VOPS :UNWIND-TO-FRAME-AND-CALL-VOP
 :RAW-INSTANCE-INIT-VOPS :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-VECTORS
 :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-FIXED-OBJECTS :ALIEN-CALLBACKS
 :CYCLE-COUNTER :INLINE-CONSTANTS :MEMORY-BARRIER-VOPS :MULTIPLY-HIGH-VOPS
 :LINKAGE-TABLE :OS-PROVIDES-DLOPEN :OS-PROVIDES-DLADDR :OS-PROVIDES-PUTWC
 :OS-PROVIDES-SUSECONDS-T :OS-PROVIDES-GETPROTOBY-R :OS-PROVIDES-POLL)

Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

Fixed in my pending tree.

Changed in sbcl:
assignee: nobody → Nikodemus Siivola (nikodemus)
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

e768e89 stricter handling of declarations in DEFGENERIC

Changed in sbcl:
assignee: Nikodemus Siivola (nikodemus) → nobody
status: Triaged → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.