[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/gnus-select c1d88db 173/218: Document DEFUN attrib
From: |
Andrew G Cohen |
Subject: |
[Emacs-diffs] feature/gnus-select c1d88db 173/218: Document DEFUN attributes |
Date: |
Fri, 14 Dec 2018 03:35:36 -0500 (EST) |
branch: feature/gnus-select
commit c1d88db13c0059d8bc74569c082a1a96a62aa698
Author: Eli Zaretskii <address@hidden>
Commit: Andrew G Cohen <address@hidden>
Document DEFUN attributes
* doc/lispref/internals.texi (Writing Emacs Primitives): Document
specification of function attributes in DEFUN.
---
doc/lispref/internals.texi | 39 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index dd573ab..7ae5b5c 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -735,7 +735,7 @@ Lisp form. For example:
@example
@group
-DEFUN ("foo", Ffoo, Sfoo, 0, UNEVALLED,
+DEFUN ("foo", Ffoo, Sfoo, 0, UNEVALLED, 0
"(list (read-char-by-name \"Insert character: \")\
(prefix-numeric-value current-prefix-arg)\
t))",
@@ -768,6 +768,43 @@ the actual documentation. The others have placeholders
beginning with
All the usual rules for documentation strings in Lisp code
(@pxref{Documentation Tips}) apply to C code documentation strings
too.
+
+The documentation string can be followed by a list of C function
+attributes for the C function that implements the primitive, like
+this:
+
address@hidden
address@hidden
+DEFUN ("bar", Fbar, Sbar, 0, UNEVALLED, 0
+ doc: /* @dots{} /*
+ attributes: @var{attr1} @var{attr2} @dots{})
address@hidden group
address@hidden example
+
address@hidden
+You can specify more than a single attribute, one after the other.
+Currently, only the following attributes are recognized:
+
address@hidden @code
address@hidden noreturn
+Declares the C function as one that never returns. This corresponds
+to the C11 keyword @code{_Noreturn} and to @address@hidden
+((__noreturn__))}} attribute of GCC (@pxref{Function Attributes,,,
+gcc, Using the GNU Compiler Collection}).
+
address@hidden const
+Declares that the function does not examine any values except its
+arguments, and has no effects except the return value. This
+corresponds to @address@hidden ((__const__))}} attribute of
+GCC.
+
address@hidden noinline
+This corresponds to @address@hidden ((__noinline__))}}
+attribute of GCC, which prevents the function from being considered
+for inlining. This might be needed, e.g., to countermand effects of
+link-time optimizations on stack-based variables.
address@hidden table
+
@end table
After the call to the @code{DEFUN} macro, you must write the
- [Emacs-diffs] feature/gnus-select aa16566 168/218: Fix Bug#30904, (continued)
- [Emacs-diffs] feature/gnus-select aa16566 168/218: Fix Bug#30904, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 8671f03 166/218: Adjust eieio persistence tests for expected failure, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 9d4baa3 165/218: Let eieio-persistent-read read what object-write has written, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select a1b7a1e 163/218: Add new tests for eieio persistence, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 267b827 170/218: Fix commit c24c5dc4a4, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 91bdd5a 157/218: Provide completion in vc-git-stash-* commands, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 8d80db1 154/218: Quieten eieio-test compilation, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 5502f96 161/218: * lisp/ibuf-ext.el (ibuffer-never-search-content-mode): Fix type., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 6dbf88e 171/218: Fix the MSDOS build, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select d5a07be 172/218: * etc/NEWS: Add an entry for auth-source-pass., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select c1d88db 173/218: Document DEFUN attributes,
Andrew G Cohen <=
- [Emacs-diffs] feature/gnus-select 0d04cb6 176/218: Fix byte-opt lists of pure functions etc., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select b36a2f9 178/218: * lisp/org/ob-lisp.el (org-babel-lisp-eval-fn): Tweak type., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 4fdc730 177/218: sql.el defcustom fixes, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select fe87972 186/218: * doc/emacs/trouble.texi: Fix location of `emacs-version' index., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 21aa752 184/218: Make update_autogen work in git worktrees, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 7985c87 188/218: * src/alloc.c: Avoid O(N²) complexity when unchaining markers (bug#24548)., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 1a1bb0c 185/218: Explain more about (defvar foo) form (Bug#18059), Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select d46646d 195/218: Replace cl in some obsolete files, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select e70347a 202/218: Limit build load, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select f06346b 198/218: Clarify syntax of radixed integers, Andrew G Cohen, 2018/12/14