GNU bug report logs -
#15862
aliases to macros at compile time
Previous Next
Full log
View this message in rfc822 format
This bug report also comes out blank in the mbox interface, but is
displayed on the web.
[...]
-----
(defvar foo-var 0)
(defmacro foo-mac ()
'(setq foo-var (1+ foo-var)))
(define-obsolete-function-alias 'old-mac #'foo-mac "24.4")
(defun foo-fails ()
(old-mac))
(defun foo-works ()
(foo-mac))
Compile:
foo.el:13:4:Warning: the function `foo-mac' is not known to be defined.
Load compiled version:
(foo-fails) ; -> (invalid-function old-mac)
Also, neither version warns that old-mac is obsolete.
I see now that
(eval-and-compile
(define-obsolete-function-alias 'old-mac #'foo-mac "24.4"))
works. So maybe that should happen automatically at top-level.
[...]
Fixed the obsolescence warning in 5e6fb1e (auto eval-and-compile make-obsolete.
The invalid function issue remains (still need to manaully eval
top-level aliases to macros at compile-time).
-----
Then I compile it in Emacs 27, I get:
Compiling file /tmp/c.el at Mon Oct 7 17:45:55 2019
In foo-fails:
c.el:9:4:Warning: ‘old-mac’ is an obsolete function (as of 24.4); use
‘foo-mac’ instead.
Which seems correct.
If I then
(load "/tmp/c.elc")
I don't get anything about invalid functions. So has this been fixed,
or am I misinterpreting what the invalid function issue is?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 3 years and 140 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.