<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/src/conf_post.h, branch scratch/ns/testing</title>
<subtitle>Emacs is the extensible, customizable, self-documenting real-time display editor. 
</subtitle>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/'/>
<entry>
<title>Port unused decls to C2x</title>
<updated>2021-10-04T03:05:09+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2021-10-04T03:04:09+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=d00f3d4c05713254b3fec19601f6944442b956ff'/>
<id>d00f3d4c05713254b3fec19601f6944442b956ff</id>
<content type='text'>
* src/conf_post.h (ATTRIBUTE_UNUSED): Remove.  All uses replaced
by MAYBE_UNUSED, and moved to start as needed for C2x.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/conf_post.h (ATTRIBUTE_UNUSED): Remove.  All uses replaced
by MAYBE_UNUSED, and moved to start as needed for C2x.
</pre>
</div>
</content>
</entry>
<entry>
<title>Clean up the fix for unexec build on GNU/Linux</title>
<updated>2021-05-20T08:26:00+00:00</updated>
<author>
<name>Eli Zaretskii</name>
</author>
<published>2021-05-20T08:26:00+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=b2eed2ae568b53ac910f4a3b8458eedf8d8c67ec'/>
<id>b2eed2ae568b53ac910f4a3b8458eedf8d8c67ec</id>
<content type='text'>
* src/conf_post.h [HYBRID_MALLOC || DARWIN_OS &amp;&amp; HAVE_UNEXEC]:
Include &lt;stdlib.h&gt; here, before redirecting 'malloc' and friends
to their hybrid_* and unexec_* equivalents.  #undef malloc and
friends before redefining.  Provide prototypes for the
replacements.  Suggested by Paul Eggert &lt;eggert@cs.ucla.edu&gt;.
* src/gmalloc.c [HYBRID_MALLOC]: Remove declarations of 'malloc'
and friends, as they are now redundant: we include &lt;stdlib.h&gt; in
conf_post.h before redefining 'malloc' etc., and that provides
prototypes from system headers.

* configure.ac (HYBRID_MALLOC): Remove kludge to avoid replacement
of 'free' by Gnulib.  (Bug#36649)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/conf_post.h [HYBRID_MALLOC || DARWIN_OS &amp;&amp; HAVE_UNEXEC]:
Include &lt;stdlib.h&gt; here, before redirecting 'malloc' and friends
to their hybrid_* and unexec_* equivalents.  #undef malloc and
friends before redefining.  Provide prototypes for the
replacements.  Suggested by Paul Eggert &lt;eggert@cs.ucla.edu&gt;.
* src/gmalloc.c [HYBRID_MALLOC]: Remove declarations of 'malloc'
and friends, as they are now redundant: we include &lt;stdlib.h&gt; in
conf_post.h before redefining 'malloc' etc., and that provides
prototypes from system headers.

* configure.ac (HYBRID_MALLOC): Remove kludge to avoid replacement
of 'free' by Gnulib.  (Bug#36649)
</pre>
</div>
</content>
</entry>
<entry>
<title>Work around __has_attribute bug in clang 3.4</title>
<updated>2021-01-22T20:02:56+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2021-01-22T19:47:22+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=b99ec5d5b11154bafb193ceaaac6976daafe3f82'/>
<id>b99ec5d5b11154bafb193ceaaac6976daafe3f82</id>
<content type='text'>
* src/conf_post.h (HAS_ATTRIBUTE):
* src/emacs-module.h.in (EMACS_ATTRIBUTE_NONNULL):
Port to clang 3.4 and earlier.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/conf_post.h (HAS_ATTRIBUTE):
* src/emacs-module.h.in (EMACS_ATTRIBUTE_NONNULL):
Port to clang 3.4 and earlier.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright year to 2021</title>
<updated>2021-01-01T09:13:56+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2021-01-01T09:13:56+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=ba05d005e5a81bc123ad8da928b1bccb6b160e7a'/>
<id>ba05d005e5a81bc123ad8da928b1bccb6b160e7a</id>
<content type='text'>
Run "TZ=UTC0 admin/update-copyright".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Run "TZ=UTC0 admin/update-copyright".
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix typos in recent attribute.h simplification</title>
<updated>2020-05-05T07:51:24+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2020-05-05T07:48:48+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=daab2d3a62ac8fb1c74987e614cee93dc79fab74'/>
<id>daab2d3a62ac8fb1c74987e614cee93dc79fab74</id>
<content type='text'>
Problem reported by Andreas Schwab in:
https://lists.gnu.org/r/emacs-devel/2020-05/msg00650.html
* src/conf_post.h (HAS_ATTR_no_sanitize): Define to false in case
cpp is picky, fixing a longstanding glitch here.
(ATTRIBUTE_NO_SANITIZE_ADDRESS, ATTRIBUTE_NO_SANITIZE_UNDEFINED):
Use HAS_ATTRIBUTE, not __has_attribute.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem reported by Andreas Schwab in:
https://lists.gnu.org/r/emacs-devel/2020-05/msg00650.html
* src/conf_post.h (HAS_ATTR_no_sanitize): Define to false in case
cpp is picky, fixing a longstanding glitch here.
(ATTRIBUTE_NO_SANITIZE_ADDRESS, ATTRIBUTE_NO_SANITIZE_UNDEFINED):
Use HAS_ATTRIBUTE, not __has_attribute.
</pre>
</div>
</content>
</entry>
<entry>
<title>Simplify by using attribute.h macros</title>
<updated>2020-05-03T22:10:07+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2020-05-03T22:06:58+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=106936415d2892fc373842b3aedd805096fc9e0e'/>
<id>106936415d2892fc373842b3aedd805096fc9e0e</id>
<content type='text'>
attribute.h is partly designed for C2X forward compatibility,
since C2X will add some standard attributes.  Using its macros
should help insulate Emacs from C2X teething problems.
* src/conf_post.h: Include attribute.h.
(HAS_ATTRIBUTE, HAS_FEATURE): Rename from __has_attribute and
__has_feature, to avoid polluting the builtin namespace.
All uses changed.
(ATTRIBUTE_COLD, ATTRIBUTE_FORMAT, FALLTHROUGH, ATTRIBUTE_CONST)
(ATTRIBUTE_PURE, ATTRIBUTE_UNUSED, ATTRIBUTE_MAY_ALIAS)
(ATTRIBUTE_MALLOC, ATTRIBUTE_ALLOC_SIZE)
(ATTRIBUTE_RETURNS_NONNULL): Remove, as attribute.h does this now.
(NO_INLINE, EXTERNALLY_VISIBLE, ARG_NONNULL, ATTRIBUTE_UNUSED):
Simplify by defining in terms of attribute.h macros.
* src/systhread.h (ATTRIBUTE_WARN_UNUSED_RESULT): Remove.
All uses replaced by attribute.h’s NODISCARD.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
attribute.h is partly designed for C2X forward compatibility,
since C2X will add some standard attributes.  Using its macros
should help insulate Emacs from C2X teething problems.
* src/conf_post.h: Include attribute.h.
(HAS_ATTRIBUTE, HAS_FEATURE): Rename from __has_attribute and
__has_feature, to avoid polluting the builtin namespace.
All uses changed.
(ATTRIBUTE_COLD, ATTRIBUTE_FORMAT, FALLTHROUGH, ATTRIBUTE_CONST)
(ATTRIBUTE_PURE, ATTRIBUTE_UNUSED, ATTRIBUTE_MAY_ALIAS)
(ATTRIBUTE_MALLOC, ATTRIBUTE_ALLOC_SIZE)
(ATTRIBUTE_RETURNS_NONNULL): Remove, as attribute.h does this now.
(NO_INLINE, EXTERNALLY_VISIBLE, ARG_NONNULL, ATTRIBUTE_UNUSED):
Simplify by defining in terms of attribute.h macros.
* src/systhread.h (ATTRIBUTE_WARN_UNUSED_RESULT): Remove.
All uses replaced by attribute.h’s NODISCARD.
</pre>
</div>
</content>
</entry>
<entry>
<title>Prefer inline functions in character.h</title>
<updated>2020-04-17T16:17:35+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2020-04-17T14:57:25+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=3e46a2315f1a999f5811f57a60a2a55f95d8fbb0'/>
<id>3e46a2315f1a999f5811f57a60a2a55f95d8fbb0</id>
<content type='text'>
In character.h, replace macros with inline functions or enums
when this is easy.  This improves maintainability and
on my platform (Fedora 31 x86-64, gcc -O2) improved CPU
performance very slightly (0.3%) on ‘make compile-always’.
* src/buffer.h (SANE_TAB_WIDTH, CHARACTER_WIDTH):
Move here from character.h, and make them inline functions.
Tune CHARACTER_WIDTH so that ASCII_CHAR_WIDTH is no longer needed.
(sanitize_tab_width, sanitize_char_width):
Move here from character.h.
* src/character.h (MAX_CHAR, MAX_UNICODE_CHAR, MAX_1_BYTE_CHAR)
(MAX_2_BYTE_CHAR, MAX_3_BYTE_CHAR, MAX_4_BYTE_CHAR)
(MAX_5_BYTE_CHAR, MIN_MULTIBYTE_LEADING_CODE)
(MAX_MULTIBYTE_LEADING_CODE, MAX_MULTIBYTE_LENGTH):
Now enum constants instead of macros.
* src/character.h (CHAR_BYTES): Redo to avoid conditional branches.
(CHAR_BYTE8_P, BYTE8_TO_CHAR, UNIBYTE_TO_CHAR, CHAR_TO_BYTE8)
(CHAR_TO_BYTE_SAFE, CHAR_BYTE8_HEAD_P, CHARACTERP)
(CHECK_CHARACTER, CHECK_CHARACTER_CAR, CHECK_CHARACTER_CDR)
(CHAR_PRINTABLE_P, CHAR_BYTES, CHAR_LEADING_CODE, BYTE8_STRING)
(LEADING_CODE_P, TRAILING_CODE_P, CHAR_HEAD_P)
(BYTES_BY_CHAR_HEAD):
Now inline functions instead of macros.
(ASCII_CHAR_WIDTH): Remove; no longer used.
* src/conf_post.h (ATTRIBUTE_PURE): New macro.
* src/lisp.h (char_table_ref): Use it, for better inlining.
* src/fns.c (base64_decode_1): Add now-necessary casts.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In character.h, replace macros with inline functions or enums
when this is easy.  This improves maintainability and
on my platform (Fedora 31 x86-64, gcc -O2) improved CPU
performance very slightly (0.3%) on ‘make compile-always’.
* src/buffer.h (SANE_TAB_WIDTH, CHARACTER_WIDTH):
Move here from character.h, and make them inline functions.
Tune CHARACTER_WIDTH so that ASCII_CHAR_WIDTH is no longer needed.
(sanitize_tab_width, sanitize_char_width):
Move here from character.h.
* src/character.h (MAX_CHAR, MAX_UNICODE_CHAR, MAX_1_BYTE_CHAR)
(MAX_2_BYTE_CHAR, MAX_3_BYTE_CHAR, MAX_4_BYTE_CHAR)
(MAX_5_BYTE_CHAR, MIN_MULTIBYTE_LEADING_CODE)
(MAX_MULTIBYTE_LEADING_CODE, MAX_MULTIBYTE_LENGTH):
Now enum constants instead of macros.
* src/character.h (CHAR_BYTES): Redo to avoid conditional branches.
(CHAR_BYTE8_P, BYTE8_TO_CHAR, UNIBYTE_TO_CHAR, CHAR_TO_BYTE8)
(CHAR_TO_BYTE_SAFE, CHAR_BYTE8_HEAD_P, CHARACTERP)
(CHECK_CHARACTER, CHECK_CHARACTER_CAR, CHECK_CHARACTER_CDR)
(CHAR_PRINTABLE_P, CHAR_BYTES, CHAR_LEADING_CODE, BYTE8_STRING)
(LEADING_CODE_P, TRAILING_CODE_P, CHAR_HEAD_P)
(BYTES_BY_CHAR_HEAD):
Now inline functions instead of macros.
(ASCII_CHAR_WIDTH): Remove; no longer used.
* src/conf_post.h (ATTRIBUTE_PURE): New macro.
* src/lisp.h (char_table_ref): Use it, for better inlining.
* src/fns.c (base64_decode_1): Add now-necessary casts.
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve inlining when compiling with -Og</title>
<updated>2020-04-08T01:26:01+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2020-04-07T23:57:04+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=b9b32074cecb0e0d20cf527eadacbb0b7f5cced9'/>
<id>b9b32074cecb0e0d20cf527eadacbb0b7f5cced9</id>
<content type='text'>
* src/conf_post.h (EXTERN_INLINE) [!EMACS_EXTERN_INLINE]:
Make it static inline, not merely static.  This is a worthwhile
performance improvement on my two platforms A and B (see below).
On my platform A this change improves user+system CPU performance of
‘make compile-always’ by 52% on an -Og build, and by 1.4% on the
default -O2 build.  On my platform B this improves the same benchmark
by 41% on an -Og build, and by -0.8% on the default -O2 build.
That "-0.8%" is a small negative for this change, and I recall that
it is why I didn't make this change earlier.  However, Platform B uses
an older GCC so we needn't worry overmuch about this small negative.

With this change the performance advantage of -O2 over -Og has dropped
on platform A; formerly -O2 was 87% faster than -Og, and now it is
only 25% faster.  On platform B the performance advantage of -O2 over
-Og has dropped from being 62% faster to being 14% faster.

Platform A is GCC 9.3.1 20200317 (Red Hat 9.3.1-1) on Fedora 31
x86-64 (AMD Phenom II X4 910e, circa 2010).  Platform B is GCC (Ubuntu
7.5.0-3ubuntu1~18.04) 7.5.0 on Ubuntu 18.04.4 (Intel Xeon E3-1225 V2,
circa 2012).

This patch was inspired by a suggestion by Andrea Corallo in:
https://lists.gnu.org/r/emacs-devel/2020-04/msg00263.html
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/conf_post.h (EXTERN_INLINE) [!EMACS_EXTERN_INLINE]:
Make it static inline, not merely static.  This is a worthwhile
performance improvement on my two platforms A and B (see below).
On my platform A this change improves user+system CPU performance of
‘make compile-always’ by 52% on an -Og build, and by 1.4% on the
default -O2 build.  On my platform B this improves the same benchmark
by 41% on an -Og build, and by -0.8% on the default -O2 build.
That "-0.8%" is a small negative for this change, and I recall that
it is why I didn't make this change earlier.  However, Platform B uses
an older GCC so we needn't worry overmuch about this small negative.

With this change the performance advantage of -O2 over -Og has dropped
on platform A; formerly -O2 was 87% faster than -Og, and now it is
only 25% faster.  On platform B the performance advantage of -O2 over
-Og has dropped from being 62% faster to being 14% faster.

Platform A is GCC 9.3.1 20200317 (Red Hat 9.3.1-1) on Fedora 31
x86-64 (AMD Phenom II X4 910e, circa 2010).  Platform B is GCC (Ubuntu
7.5.0-3ubuntu1~18.04) 7.5.0 on Ubuntu 18.04.4 (Intel Xeon E3-1225 V2,
circa 2012).

This patch was inspired by a suggestion by Andrea Corallo in:
https://lists.gnu.org/r/emacs-devel/2020-04/msg00263.html
</pre>
</div>
</content>
</entry>
<entry>
<title>Pacify GCC 9.2.1 20190927 -O3</title>
<updated>2020-03-04T21:48:58+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2020-03-04T21:48:26+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=dc3006cf1419e5b22c35fa36d79ba029d0482df1'/>
<id>dc3006cf1419e5b22c35fa36d79ba029d0482df1</id>
<content type='text'>
Original problem report by N. Jackson in:
https://lists.gnu.org/r/emacs-devel/2020-03/msg00047.html
I found some other warnings when I used gcc, and fixed them
with this patch.
* lib-src/etags.c: Include verify.h.
(xnmalloc, xnrealloc): Tell the compiler that NITEMS is
nononnegative and ITEM_SIZE is positive.
* src/conf_post.h (__has_attribute_returns_nonnull)
(ATTRIBUTE_RETURNS_NONNULL): New macros.
* src/editfns.c (Fuser_full_name): Don’t assume Fuser_login_name
returns non-nil.
* src/intervals.c (rotate_right, rotate_left, update_interval):
* src/intervals.h (LENGTH, LEFT_TOTAL_LENGTH, RIGHT_TOTAL_LENGTH):
Use TOTAL_LENGTH0 or equivalent on intervals that might be null.
* src/intervals.h (TOTAL_LENGTH): Assume arg is nonnull.
(TOTAL_LENGTH0): New macro, with the old TOTAL_LENGTH meaning.
(make_interval, split_interval_right): Add ATTRIBUTE_RETURNS_NONNULL.
* src/pdumper.c (dump_check_dump_off): Now returns void, since
no caller uses the return value.  Redo assert to pacify GCC.
(decode_emacs_reloc): Add a seemingly-random eassume to pacify GCC.
Ugly, and I suspect due to a bug in GCC.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Original problem report by N. Jackson in:
https://lists.gnu.org/r/emacs-devel/2020-03/msg00047.html
I found some other warnings when I used gcc, and fixed them
with this patch.
* lib-src/etags.c: Include verify.h.
(xnmalloc, xnrealloc): Tell the compiler that NITEMS is
nononnegative and ITEM_SIZE is positive.
* src/conf_post.h (__has_attribute_returns_nonnull)
(ATTRIBUTE_RETURNS_NONNULL): New macros.
* src/editfns.c (Fuser_full_name): Don’t assume Fuser_login_name
returns non-nil.
* src/intervals.c (rotate_right, rotate_left, update_interval):
* src/intervals.h (LENGTH, LEFT_TOTAL_LENGTH, RIGHT_TOTAL_LENGTH):
Use TOTAL_LENGTH0 or equivalent on intervals that might be null.
* src/intervals.h (TOTAL_LENGTH): Assume arg is nonnull.
(TOTAL_LENGTH0): New macro, with the old TOTAL_LENGTH meaning.
(make_interval, split_interval_right): Add ATTRIBUTE_RETURNS_NONNULL.
* src/pdumper.c (dump_check_dump_off): Now returns void, since
no caller uses the return value.  Redo assert to pacify GCC.
(decode_emacs_reloc): Add a seemingly-random eassume to pacify GCC.
Ugly, and I suspect due to a bug in GCC.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright year to 2020</title>
<updated>2020-01-01T00:59:52+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2020-01-01T00:19:43+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=365e01cc9f64ce6ca947ccfd8612d60763280a37'/>
<id>365e01cc9f64ce6ca947ccfd8612d60763280a37</id>
<content type='text'>
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
</pre>
</div>
</content>
</entry>
</feed>
