aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2023-02-04 15:53:40 -0800
committerPaul Eggert2023-02-04 15:58:42 -0800
commitd27d9a43d4d1b3f8a213cb739f4d27793158a050 (patch)
tree7ff6efdf11cdddcabc1bb63d8e21ba0687d7099f /src
parentb429274c5b4b2b511d2d351111dea2d354498e0f (diff)
downloademacs-d27d9a43d4d1b3f8a213cb739f4d27793158a050.tar.gz
emacs-d27d9a43d4d1b3f8a213cb739f4d27793158a050.zip
Update some commentary for C23
Diffstat (limited to 'src')
-rw-r--r--src/floatfns.c7
-rw-r--r--src/lisp.h7
-rw-r--r--src/xdisp.c2
3 files changed, 10 insertions, 6 deletions
diff --git a/src/floatfns.c b/src/floatfns.c
index 1d891ef3ce1..13f0ca3e129 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -27,19 +27,22 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
27 frexp, ldexp, log, log10 [via (log X 10)], *modf, pow, sin, *sinh, 27 frexp, ldexp, log, log10 [via (log X 10)], *modf, pow, sin, *sinh,
28 sqrt, tan, *tanh. 28 sqrt, tan, *tanh.
29 29
30 C99 and C11 require the following math.h functions in addition to 30 C99, C11 and C17 require the following math.h functions in addition to
31 the C89 functions. Of these, Emacs currently exports only the 31 the C89 functions. Of these, Emacs currently exports only the
32 starred ones to Lisp, since we haven't found a use for the others. 32 starred ones to Lisp, since we haven't found a use for the others.
33 Also, it uses the ones marked "+" internally: 33 Also, it uses the ones marked "+" internally:
34 acosh, atanh, cbrt, copysign (implemented by signbit), erf, erfc, 34 acosh, atanh, cbrt, copysign (implemented by signbit), erf, erfc,
35 exp2, expm1, fdim, fma, fmax, fmin, fpclassify, hypot, +ilogb, 35 exp2, expm1, fdim, fma, fmax, fmin, fpclassify, hypot, +ilogb,
36 isfinite, isgreater, isgreaterequal, isinf, isless, islessequal, 36 +isfinite, isgreater, isgreaterequal, +isinf, isless, islessequal,
37 islessgreater, *isnan, isnormal, isunordered, lgamma, log1p, *log2 37 islessgreater, *isnan, isnormal, isunordered, lgamma, log1p, *log2
38 [via (log X 2)], logb (approximately; implemented by frexp), 38 [via (log X 2)], logb (approximately; implemented by frexp),
39 +lrint/llrint, +lround/llround, nan, nearbyint, nextafter, 39 +lrint/llrint, +lround/llround, nan, nearbyint, nextafter,
40 nexttoward, remainder, remquo, *rint, round, scalbln, +scalbn, 40 nexttoward, remainder, remquo, *rint, round, scalbln, +scalbn,
41 +signbit, tgamma, *trunc. 41 +signbit, tgamma, *trunc.
42 42
43 C23 requires many more math.h functions. Emacs does not yet export
44 or use them.
45
43 The C standard also requires functions for float and long double 46 The C standard also requires functions for float and long double
44 that are not listed above. Of these functions, Emacs uses only the 47 that are not listed above. Of these functions, Emacs uses only the
45 following internally: fabsf, powf, sprintf. 48 following internally: fabsf, powf, sprintf.
diff --git a/src/lisp.h b/src/lisp.h
index 196615effd8..0bc400ba78f 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -272,7 +272,7 @@ DEFINE_GDB_SYMBOL_END (VALMASK)
272 emacs_align_type union in alloc.c. 272 emacs_align_type union in alloc.c.
273 273
274 Although these macros are reasonably portable, they are not 274 Although these macros are reasonably portable, they are not
275 guaranteed on non-GCC platforms, as C11 does not require support 275 guaranteed on non-GCC platforms, as the C standard does not require support
276 for alignment to GCALIGNMENT and older compilers may ignore 276 for alignment to GCALIGNMENT and older compilers may ignore
277 alignment requests. For any type T where garbage collection 277 alignment requests. For any type T where garbage collection
278 requires alignment, use verify (GCALIGNED (T)) to verify the 278 requires alignment, use verify (GCALIGNED (T)) to verify the
@@ -2962,9 +2962,10 @@ XFLOAT_DATA (Lisp_Object f)
2962/* Most hosts nowadays use IEEE floating point, so they use IEC 60559 2962/* Most hosts nowadays use IEEE floating point, so they use IEC 60559
2963 representations, have infinities and NaNs, and do not trap on 2963 representations, have infinities and NaNs, and do not trap on
2964 exceptions. Define IEEE_FLOATING_POINT to 1 if this host is one of the 2964 exceptions. Define IEEE_FLOATING_POINT to 1 if this host is one of the
2965 typical ones. The C11 macro __STDC_IEC_559__ is close to what is 2965 typical ones. The C23 macro __STDC_IEC_60559_BFP__ (or its
2966 obsolescent C11 counterpart __STDC_IEC_559__) is close to what is
2966 wanted here, but is not quite right because Emacs does not require 2967 wanted here, but is not quite right because Emacs does not require
2967 all the features of C11 Annex F (and does not require C11 at all, 2968 all the features of C23 Annex F (and does not require C11 or later,
2968 for that matter). */ 2969 for that matter). */
2969 2970
2970#define IEEE_FLOATING_POINT (FLT_RADIX == 2 && FLT_MANT_DIG == 24 \ 2971#define IEEE_FLOATING_POINT (FLT_RADIX == 2 && FLT_MANT_DIG == 24 \
diff --git a/src/xdisp.c b/src/xdisp.c
index 72d3bfa6398..398056144a8 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12448,7 +12448,7 @@ display_echo_area (struct window *w)
12448 reset the echo_area_buffer in question to nil at the end because 12448 reset the echo_area_buffer in question to nil at the end because
12449 with_echo_area_buffer will set it to an empty buffer. */ 12449 with_echo_area_buffer will set it to an empty buffer. */
12450 bool i = display_last_displayed_message_p; 12450 bool i = display_last_displayed_message_p;
12451 /* According to the C99, C11 and C++11 standards, the integral value 12451 /* According to the C standard, the integral value
12452 of a "bool" is always 0 or 1, so this array access is safe here, 12452 of a "bool" is always 0 or 1, so this array access is safe here,
12453 if oddly typed. */ 12453 if oddly typed. */
12454 no_message_p = NILP (echo_area_buffer[i]); 12454 no_message_p = NILP (echo_area_buffer[i]);