From: Stefan Kangas <stefankangas@gmail.com>
To: "Gerd Möllmann" <gerd.moellmann@gmail.com>, emacs-devel@gnu.org
Subject: Re: CL packages landed
Date: Thu, 20 Oct 2022 23:42:27 -0700 [thread overview]
Message-ID: <CADwFkm=2+62bkbujpJTExhuUzjMymKZxecjy4QRJpOeREpkJWQ@mail.gmail.com> (raw)
In-Reply-To: <m2czaleqba.fsf@Mini.fritz.box>
[-- Attachment #1: Type: text/plain, Size: 801 bytes --]
Gerd Möllmann <gerd.moellmann@gmail.com> writes:
> I've pushed the branch "pkg" which implements CL packages for Emacs.
I saw these GCC warnings while compiling:
pkg.c:43:3: warning: function ‘pkg_error’ might be a candidate for
‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
43 | verror (fmt, ap);
| ^~~~~~
pkg.c:39:1: warning: function might be candidate for attribute
‘noreturn’ [-Wsuggest-attribute=noreturn]
39 | pkg_error (const char *fmt, ...)
| ^~~~~~~~~
See the attached attempt to fix them.
While playing around with this, I also came up with the attached small
additions to the test suite (loosely based on the HyperSpec).
BTW, I think according to our branch naming conventions this should be
named "feature/pkg"?
[-- Attachment #2: 0001-src-lisp.h-pkg_error-Fix-GCC-warning-in-declaration.patch --]
[-- Type: text/x-diff, Size: 963 bytes --]
From 6987c5bbb794a001f6e5654bd9ea9c0e097bac09 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Fri, 21 Oct 2022 08:12:59 +0200
Subject: [PATCH 1/2] * src/lisp.h (pkg_error): Fix GCC warning in declaration.
---
src/lisp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lisp.h b/src/lisp.h
index 2042dbbd2f..f60583a150 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2272,7 +2272,7 @@ PACKAGE_NAMEX (Lisp_Object package)
extern void init_pkg (void);
extern void syms_of_pkg (void);
extern Lisp_Object pkg_qualified_symbol (Lisp_Object name, Lisp_Object package, bool external);
-extern void pkg_error (const char *fmt, ...);
+extern _Noreturn void pkg_error (const char *fmt, ...) ATTRIBUTE_FORMAT_PRINTF (1, 0);
extern Lisp_Object pkg_unqualified_symbol (Lisp_Object name);
extern bool pkg_keywordp (Lisp_Object obj);
extern Lisp_Object pkg_define_symbol (Lisp_Object sym, Lisp_Object package);
--
2.35.1
[-- Attachment #3: 0002-Fix-cl-intern-cl-unintern-tests.patch --]
[-- Type: text/x-diff, Size: 1144 bytes --]
From dd02db5702e46af6543be14cb05d981fa261ad1a Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Fri, 21 Oct 2022 08:13:25 +0200
Subject: [PATCH 2/2] Fix cl-intern/cl-unintern tests
* test/src/pkg-tests.el (pkg-tests-cl-intern)
(pkg-tests-cl-unintern): Fix tests.
---
test/src/pkg-tests.el | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/test/src/pkg-tests.el b/test/src/pkg-tests.el
index 1cfea6a632..aff6ff0eb5 100644
--- a/test/src/pkg-tests.el
+++ b/test/src/pkg-tests.el
@@ -126,10 +126,21 @@ pkg-tests-find-symbol
(should nil))
(ert-deftest pkg-tests-cl-intern ()
- (should nil))
+ (cl-assert (not (find-symbol "foo")))
+ (unwind-protect
+ (progn
+ (cl-intern "foo")
+ (should (find-symbol "foo")))
+ (cl-unintern 'foo)))
(ert-deftest pkg-tests-cl-unintern ()
- (should nil))
+ (cl-assert (not (find-symbol "foo")))
+ (unwind-protect
+ (progn
+ (cl-intern "foo")
+ (cl-unintern 'foo)
+ (should-not (find-symbol "foo")))
+ (cl-unintern 'foo)))
(ert-deftest pkg-tests-export ()
(should nil))
--
2.35.1
next prev parent reply other threads:[~2022-10-21 6:42 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-21 4:47 CL packages landed Gerd Möllmann
2022-10-21 5:35 ` Po Lu
2022-10-21 6:42 ` Stefan Kangas [this message]
2022-10-21 6:48 ` Gerd Möllmann
2022-10-21 6:55 ` Po Lu
2022-10-21 6:58 ` Gerd Möllmann
2022-10-21 7:46 ` Eli Zaretskii
2022-10-21 8:01 ` Gerd Möllmann
2022-10-21 10:48 ` Eli Zaretskii
2022-10-21 10:49 ` Gerd Möllmann
2022-10-21 13:04 ` Stefan Monnier
2022-10-21 14:01 ` Gerd Möllmann
2022-10-22 9:40 ` Michael Albinus
2022-10-22 10:20 ` Gerd Möllmann
2022-10-22 15:09 ` Michael Albinus
2022-10-22 15:45 ` Gerd Möllmann
2022-10-22 10:24 ` Stefan Kangas
2022-10-22 15:06 ` Michael Albinus
2022-10-21 6:50 ` Gerd Möllmann
2022-10-21 7:42 ` Andrea Corallo
2022-10-21 7:57 ` Gerd Möllmann
2022-10-21 15:06 ` [External] : " Drew Adams
2022-10-21 17:21 ` Gerd Möllmann
2022-10-21 20:13 ` Drew Adams
2022-10-22 10:56 ` Philip Kaludercic
2022-10-22 12:13 ` Gerd Möllmann
2022-10-23 19:14 ` Richard Stallman
2022-10-24 4:17 ` Gerd Möllmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CADwFkm=2+62bkbujpJTExhuUzjMymKZxecjy4QRJpOeREpkJWQ@mail.gmail.com' \
--to=stefankangas@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=gerd.moellmann@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).