~theo/clws-devel

6 4

Zero byte-compiler warnings in the test suite

Stefan Kangas <stefan@marxist.se>
Details
Message ID
<CADwFkmkXRRQbyXeGQpgHbm+Y+rBSFZhAKBAcBWAkuEe2+h=UrA@mail.gmail.com>
DKIM signature
missing
Download raw message
Dear emacs-devel,

I would like to bring to your attention that we now have a test suite
with no byte-compiler warnings.  This is nice, as there is less noise,
and it will be easier to spot real problems.

In my use, I'm happy that I can now look at a soothing zero in the mode
line of my *Compilation* buffer when saying "make && make check".  ;-)

Thanks to everyone who helped with this.
Lars Ingebrigtsen <larsi@gnus.org>
Details
Message ID
<87ilvigl3z.fsf@gnus.org>
In-Reply-To
<CADwFkmkXRRQbyXeGQpgHbm+Y+rBSFZhAKBAcBWAkuEe2+h=UrA@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
Stefan Kangas <stefan@marxist.se> writes:

> In my use, I'm happy that I can now look at a soothing zero in the mode
> line of my *Compilation* buffer when saying "make && make check".  ;-)

That's great, and it's indeed much more soothing.  😀

But with a native-comp build (at least), I'm getting two
warnings/errors on the current trunk: 

In toplevel form:
lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el:273:1: Warning: ‘defgeneric’ is an obsolete macro (as of 25.1); use ‘cl-defgeneric’ instead.

and

Compiler-macro error for cl-typep: (error "Unknown type notatype")
Compiler-macro error for cl-typep: (error "Unknown type notatype")
Compiler-macro error for cl-typep: (error "Unknown type notatype")
Compiler-macro error for cl-typep: (error "Unknown type notatype")
Compiler-macro error for cl-typep: (error "Unknown type notatype")

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no
Stefan Kangas <stefan@marxist.se>
Details
Message ID
<CADwFkm=nubx_9iXb=h4DZp0bQWshZ1NLZ4nF7Lc=Nv+LCxk-cg@mail.gmail.com>
In-Reply-To
<87ilvigl3z.fsf@gnus.org> (view parent)
DKIM signature
missing
Download raw message
Lars Ingebrigtsen <larsi@gnus.org> writes:

> But with a native-comp build (at least), I'm getting two
> warnings/errors on the current trunk:
>
> In toplevel form:
> lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el:273:1: Warning: ‘defgeneric’ is an obsolete macro (as of 25.1); use ‘cl-defgeneric’ instead.

Strange, I don't see that here (with native-comp).  Does this help?

diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el
b/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el
index e881e46a2d..bc89f23b58 100644
--- a/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el
+++ b/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el
@@ -271,6 +271,7 @@ E-base2
 (defclass E (E-base1 E-base2) () :method-invocation-order :breadth-first)

 (with-suppressed-warnings ((obsolete defmethod)
+                           (obsolete defgeneric)
                            (obsolete next-method-p)
                            (obsolete call-next-method))
   (defmethod eitest-F ((_p E))

> Compiler-macro error for cl-typep: (error "Unknown type notatype")
> Compiler-macro error for cl-typep: (error "Unknown type notatype")
> Compiler-macro error for cl-typep: (error "Unknown type notatype")
> Compiler-macro error for cl-typep: (error "Unknown type notatype")
> Compiler-macro error for cl-typep: (error "Unknown type notatype")

I've seen these as well, but they weren't counted by compilation-mode so
I just sort of ignored them.  It would be good to fix them as well of
course.

AFAICT, they come from here:

  ELC+ELN  lisp/emacs-lisp/pcase-tests.elc
Compiler-macro error for cl-typep: (error "Unknown type notatype")
Compiler-macro error for cl-typep: (error "Unknown type notatype")
Compiler-macro error for cl-typep: (error "Unknown type notatype")
Compiler-macro error for cl-typep: (error "Unknown type notatype")
Compiler-macro error for cl-typep: (error "Unknown type notatype")
  GEN      lisp/emacs-lisp/pcase-tests.log

Grepping for notatype leads me to:

./lisp/emacs-lisp/pcase-tests.el:111:                  ((cl-type
notatype) 'integer))))

Does anyone know what is going on here?
Lars Ingebrigtsen <larsi@gnus.org>
Details
Message ID
<87ee66gja6.fsf@gnus.org>
In-Reply-To
<CADwFkm=nubx_9iXb=h4DZp0bQWshZ1NLZ4nF7Lc=Nv+LCxk-cg@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
Stefan Kangas <stefan@marxist.se> writes:

> Strange, I don't see that here (with native-comp).  Does this help?

[...]

>  (with-suppressed-warnings ((obsolete defmethod)
> +                           (obsolete defgeneric)

Yup, that fixes it.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no
Eli Zaretskii <eliz@gnu.org>
Details
Message ID
<83lf0eypnx.fsf@gnu.org>
In-Reply-To
<CADwFkmkXRRQbyXeGQpgHbm+Y+rBSFZhAKBAcBWAkuEe2+h=UrA@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
> From: Stefan Kangas <stefan@marxist.se>
> Date: Tue, 21 Dec 2021 04:36:51 -0800
> 
> Dear emacs-devel,
> 
> I would like to bring to your attention that we now have a test suite
> with no byte-compiler warnings.

Thanks to all those who work relentlessly on making the tests
warning-free.
Stefan Kangas <stefan@marxist.se>
Details
Message ID
<CADwFkmm7i7tyU08CRgQVRMvLmKKjU6mC4o_S8WYaUJf5mBe4SQ@mail.gmail.com>
In-Reply-To
<87ee66gja6.fsf@gnus.org> (view parent)
DKIM signature
missing
Download raw message
Lars Ingebrigtsen <larsi@gnus.org> writes:

> Yup, that fixes it.

Thanks, pushed to master as commit 1a923e5ac6.
Details
Message ID
<jwv7dby6kal.fsf-monnier+emacs@gnu.org>
In-Reply-To
<CADwFkm=nubx_9iXb=h4DZp0bQWshZ1NLZ4nF7Lc=Nv+LCxk-cg@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
> Compiler-macro error for cl-typep: (error "Unknown type notatype")
>   GEN      lisp/emacs-lisp/pcase-tests.log
>
> Grepping for notatype leads me to:
>
> ./lisp/emacs-lisp/pcase-tests.el:111:                  ((cl-type
> notatype) 'integer))))
>
> Does anyone know what is going on here?

I thought it was pretty obvious: `c-type` takes a type as argument, but
`notatype` is ... not declared as a type, so we get an error.

The test expects the error to be signal'd at run time whereas the
compiler macro prefers to signal the error right away.
As a bias observer, I'd suggest to fix the test rather than the compiler
macro ;-)


        Stefan
Reply to thread Export thread (mbox)