GNU bug report logs -
#25556
26.0.50.1; Requiring uncompiled eieio issues obsoletion warnings
Previous Next
Reported by: David Engster <deng <at> randomsample.de>
Date: Fri, 27 Jan 2017 20:40:02 UTC
Severity: minor
Tags: fixed
Found in version 26.0.50.1
Fixed in version 27.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
David Engster <deng <at> randomsample.de> writes:
> Eli Zaretskii writes:
>>> From: David Engster <deng <at> randomsample.de>
>>> Date: Fri, 27 Jan 2017 21:38:58 +0100
>>>
>>
>>> I'm currently trying to fix compiler warnings during the CEDET compile
>>> in Emacs master, but there's one annoying problem I'm unsure how to
>>> fix. Whenever a file does (require 'eieio), and EIEIO is not yet
>>> byte-compiled, those two warnings are issued:
>>>
>>> ../../emacs-lisp/eieio.el: ‘eieio-object-name-string’ is an obsolete
>>> generic function (as of 25.1); use ‘eieio-named’ instead.
>>> ../../emacs-lisp/eieio.el: ‘destructor’ is an obsolete generic
>>> function (as of 26.1).
>>>
>>> Since EIEIO is compiled pretty late, one is flooded with these warnings
>>> when compiling Emacs master. The warnings seems to come from the
>>> cl-defgeneric for `eieio-object-name-string' and `destructor'. How can
>>> this be dealt with?
>>
>> Is it possibel to arrange that these files be compiled sooner? We
>> already have some targets for similar purposes in lisp/Makefile.
>
> I'm sure that's possible, but why does the file that declares those
> constructs obsolete *itself* throw these warnings? I was hoping that
> this could be fixed instead.
I'm not sure about `eieio-object-name-string', but the message about
`destructor' is because cl-defgeneric makes the declaration handling
code run before the function defining code, so the symbol is declared
obsolete before it's defined and the definition itself triggers the
obsolete warning. The patch below moves it around and stops the
`destructor' warning:
--- i/lisp/emacs-lisp/cl-generic.el
+++ w/lisp/emacs-lisp/cl-generic.el
@@ -226,7 +226,13 @@ cl-defgeneric
(when (eq 'setf (car-safe name))
(require 'gv)
(setq name (gv-setter (cadr name))))
- `(progn
+ `(prog1
+ (progn
+ (defalias ',name
+ (cl-generic-define ',name ',args ',(nreverse options))
+ ,(help-add-fundoc-usage doc args))
+ ,@(mapcar (lambda (method) `(cl-defmethod ,name ,@method))
+ (nreverse methods)))
,@(mapcar (lambda (declaration)
(let ((f (cdr (assq (car declaration)
defun-declarations-alist))))
@@ -235,12 +241,7 @@ cl-defgeneric
(t (message "Warning: Unknown defun property `%S' in %S"
(car declaration) name)
nil))))
- (cdr declarations))
- (defalias ',name
- (cl-generic-define ',name ',args ',(nreverse options))
- ,(help-add-fundoc-usage doc args))
- ,@(mapcar (lambda (method) `(cl-defmethod ,name ,@method))
- (nreverse methods)))))
+ (cdr declarations)))))
;;;###autoload
(defun cl-generic-define (name args options)
This bug report was last modified 4 years and 330 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.