From 0f731c49e6a8ccf3aa4c30c3f8ca82ed0a2cefb7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 12 May 2022 17:01:10 -0700 Subject: Pacify GCC 12 in default developer build This lets ‘./configure; make’ work on Fedora 36 x86-64 from a Git checkout without generating false-alarm warnings. * lib-src/etags.c (main): There appeared to be false alarm with GCC 12. However, the code was wrong anyway, as it mishandled file names containing "'" so fix that bug. This pacifies GCC. (mercury_decl): Omit tests ‘s + pos != NULL’ that were apparently intended to be ‘s[pos] != '\0'’ but which were miscoded to always be true and which were mostly not needed anyway. In one place, though, a test was needed, so fix that by using strchr instead. * src/alloc.c (lisp_free) [!GC_MALLOC_CHECK]: * src/term.c (Fsuspend_tty): Don’t look at a pointer after freeing it, even just to test it for equality with some other pointer, as this has undefined behavior in C and GCC 12 diagnoses this. * src/dbusbind.c (xd_read_message_1): Rework the code a bit so that it has fewer tests. This pacifies GCC 12 which was complaining incorrectly about dereferencing a null pointer. * src/intervals.c (copy_properties): Remove an eassume that should no longer be needed even to pacify older GCCs, due to ... * src/intervals.h (split_interval_left): ... this addition of ATTRIBUTE_RETURNS_NONNULL to pacify a GCC 12 warning about dereferencing a null pointer. * src/regex-emacs.c (EXTEND_BUFFER): Use negative values rather than auxiliary booleans to indicate null pointers. This pacifies GCC 12 false alarms about using uninitialized variables. * src/xdisp.c (clear_position): New function. (append_space_for_newline, extend_face_to_end_of_line): Use it to work around false alarms from GCC 12. (display_and_set_cursor): Add an UNINIT to pacify GCC 12. * src/xterm.c (x_draw_glyphless_glyph_string_foreground): Defend against hypothetical bad code elsewhere; this also pacifies GCC 12. (x_term_init): Use fixed-size auto array rather than alloca, as the array is small; this also pacifies GCC 12. --- src/alloc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/alloc.c') diff --git a/src/alloc.c b/src/alloc.c index 43fbbb79bed..3cfc3d61ddd 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -1032,9 +1032,12 @@ lisp_free (void *block) return; MALLOC_BLOCK_INPUT; +#ifndef GC_MALLOC_CHECK + struct mem_node *m = mem_find (block); +#endif free (block); #ifndef GC_MALLOC_CHECK - mem_delete (mem_find (block)); + mem_delete (m); #endif MALLOC_UNBLOCK_INPUT; } -- cgit v1.2.1 From 59951f7af5877221a25d66a1344b649c6872bac6 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 24 May 2022 11:51:18 +0200 Subject: Audit quoting symbols in C doc strings * test/manual/etags/c-src/emacs/src/keyboard.c (Frecursive_edit): * src/xfns.c (syms_of_xfns): * src/xdisp.c (Fwindow_text_pixel_size): (syms_of_xdisp): * src/w32notify.c (Fw32notify_add_watch): (Fw32notify_add_watch): * src/frame.c (Fframe_child_frame_border_width): * src/comp.c (Fcomp__subr_signature): * src/alloc.c (Fgarbage_collect): * lib-src/make-docfile.c (scan_c_stream): Audit quoting symbols in C doc strings. --- src/alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/alloc.c') diff --git a/src/alloc.c b/src/alloc.c index 3cfc3d61ddd..cfa51c0a8dc 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -6302,7 +6302,7 @@ where each entry has the form (NAME SIZE USED FREE), where: to return them to the OS). However, if there was overflow in pure space, and Emacs was dumped -using the 'unexec' method, `garbage-collect' returns nil, because +using the \"unexec\" method, `garbage-collect' returns nil, because real GC can't be done. Note that calling this function does not guarantee that absolutely all -- cgit v1.2.1 From b903507b36c438653a02d7b6291e9744d5221e28 Mon Sep 17 00:00:00 2001 From: Mattias Engdegård Date: Tue, 24 May 2022 13:02:14 +0200 Subject: Nonrecursive Lisp reader (bug#55676) Restructure the reader to be nonrecursive so that it is not limited by the C stack or crashes Emacs when reading deeply nested data. This also improves performance. A few minor bugs were fixed: - (a .{NBSP}b) where {NBSP} is a non-breaking space (U+00A0) is now the dotted pair (a . b), not the 3-element list (a \. b), since U+00A0 is treated as whitespace everywhere else. - #_ with no symbol following is now equivalent to ## (empty interned symbol), not #: (empty uninterned symbol). * src/alloc.c (garbage_collect): Call mark_lread. * src/lread.c (readevalloop): Use read0 instead of read_list. (stackbufsize): Increase to 1024, now that read0 isn't recursive. (invalid_radix_integer): Buffer overflow check. (read1, read_list, read_vector): Remove. (read_char_literal, read_string_literal) (hash_table_from_plist, record_from_list, vector_from_rev_list) (bytecode_from_rev_list, char_table_from_rev_list) (sub_char_table_from_rev_list, string_props_from_rev_list) (read_bool_vector, skip_lazy_string, symbol_char_span) (skip_space_and_comments) (enum read_entry_type, struct read_stack_entry, struct read_stack) (rdstack, mark_lread, read_stack_top, read_stack_pop) (read_stack_empty_p, grow_read_stack, read_stack_push): New. (read0): Rewrite to be nonrecursive. * test/src/lread-tests.el (lread-deeply-nested, lread-misc): New tests. --- src/alloc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/alloc.c') diff --git a/src/alloc.c b/src/alloc.c index cfa51c0a8dc..02d3a3ea3a2 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -6180,6 +6180,7 @@ garbage_collect (void) mark_pinned_objects (); mark_pinned_symbols (); + mark_lread (); mark_terminals (); mark_kboards (); mark_threads (); -- cgit v1.2.1