1. 05 May, 2020 1 commit
  2. 03 May, 2020 1 commit
    • Paul Eggert's avatar
      Simplify by using attribute.h macros · 10693641
      Paul Eggert authored
      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.
      10693641
  3. 17 Apr, 2020 1 commit
    • Paul Eggert's avatar
      Prefer inline functions in character.h · 3e46a231
      Paul Eggert authored
      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.
      3e46a231
  4. 08 Apr, 2020 1 commit
    • Paul Eggert's avatar
      Improve inlining when compiling with -Og · b9b32074
      Paul Eggert authored
      * 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
      b9b32074
  5. 04 Mar, 2020 1 commit
    • Paul Eggert's avatar
      Pacify GCC 9.2.1 20190927 -O3 · dc3006cf
      Paul Eggert authored
      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.
      dc3006cf
  6. 01 Jan, 2020 1 commit
  7. 05 Sep, 2019 1 commit
    • Paul Eggert's avatar
      Use plain ‘static’ for Emacs C inline functions · 365dad19
      Paul Eggert authored
      This improved performance of ‘make compile-always’ by 8.2%
      on my platform (AMD Phenom II X4 910e, Fedora 30 x86-64).
      * src/conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
      (INLINE_HEADER_END) [!EMACS_EXTERN_INLINE]: Use plain ‘static’.
      365dad19
  8. 29 Apr, 2019 1 commit
  9. 22 Apr, 2019 1 commit
    • Paul Eggert's avatar
      Improve wur coverage on older GCCs · 88824197
      Paul Eggert authored
      * src/conf_post.h (__has_attribute_warn_unused_result):
      New macro for compilers lacking __has_attribute.
      * src/systhread.h (__has_attribute): Remove ineffective define.
      (ATTRIBUTE_WARN_UNUSED_RESULT): Work better on GCC 3.4 thru 4.
      88824197
  10. 18 Apr, 2019 1 commit
    • Paul Eggert's avatar
      Mark _Noreturn error functions as cold · 6d6c55db
      Paul Eggert authored
      On my platform this made ‘make compile-always’ 1.3% faster.
      Suggested by Alex Gramiak in:
      https://lists.gnu.org/r/emacs-devel/2019-04/msg00684.html
      * configure.ac (nw): Don’t use -Wsuggest-attribute=cold.
      * lib-src/make-docfile.c (write_globals):
      Mark noreturn functions as cold.
      * src/callproc.c (exec_failed):
      * src/data.c (wrong_length_argument, wrong_type_argument):
      * src/emacs-module.c (module_abort):
      * src/emacs.c (terminate_due_to_signal):
      * src/eval.c (unwind_to_catch):
      * src/image.c (my_png_error, my_error_exit):
      * src/json.c (json_out_of_memory, json_parse_error):
      * src/keyboard.c (quit_throw_to_read_char, user_error):
      * src/lisp.h (die, wrong_type_argument, wrong_choice)
      (args_out_of_range, args_out_of_range_3, circular_list)
      (buffer_overflow, memory_full, buffer_memory_full)
      (string_overflow, xsignal, xsignal0, xsignal1, xsignal2)
      (xsignal3, signal_error, overflow_error, error, verror)
      (nsberror, report_file_errno, report_file_error)
      (report_file_notify_error, terminate_due_to_signal)
      (emacs_abort, fatal):
      * src/lread.c (load_error_old_style_backquotes)
      (end_of_file_error, invalid_syntax):
      * src/pdumper.c (error_unsupported_dump_object):
      * src/puresize.h (pure_write_error):
      * src/search.c (matcher_overflow):
      * src/sound.c (sound_perror, alsa_sound_perror):
      * src/sysdep.c (handle_arith_signal):
      * src/systime.h (time_overflow):
      * src/term.c (maybe_fatal, vfatal):
      * src/textprop.c (text_read_only):
      * src/timefns.c (invalid_time_zone_specification)
      (time_error, invalid_hz):
      * src/xterm.c (x_connection_closed):
      Use AVOID instead of _Noreturn void, so that it’s marked cold.
      * src/conf_post.h (__has_attribute_cold) [!__has_attribute]:
      New macro.
      (ATTRIBUTE_COLD): New macro.
      * src/frame.h (WINDOW_SYSTEM_RETURN): Add ATTRIBUTE_COLD.
      * src/lisp.h (AVOID): New macro.
      * src/xterm.c: Omit unnecessary static decls, so that we needn’t
      worry about which functions should be marked cold.
      (x_io_error_quitter): Mark as cold.
      6d6c55db
  11. 01 Feb, 2019 1 commit
    • Paul Eggert's avatar
      Rename CANNOT_DUMP to HAVE_UNEXEC · 3b69e02a
      Paul Eggert authored
      * configure.ac (CANNOT_DUMP): Remove.  All uses removed,
      or changed to the negative of with_unexec.
      (HAVE_UNEXEC): New macro.  All uses of CANNOT_DUMP changed
      to the negative of this macro.
      3b69e02a
  12. 15 Jan, 2019 1 commit
    • Daniel Colascione's avatar
      Add portable dumper · d12e5d00
      Daniel Colascione authored
      Add a new portable dumper as an alternative to unexec.  Use it by default.
      
      * src/dmpstruct.awk: New file.
      * src/doc.c (get_doc_string): use will_dump_p().
      * src/editfns.c (styled_format): silence compiler warning
      with UNINIT.
      * src/emacs-module.c (syms_of_module): staticpro ltv_mark.
      * src/emacs.c (gflags): new variable.
      (init_cmdargs): unwrap
      (string_starts_with_p, find_argument, dump_error_to_string)
      (load_pdump): new functions.
      (main): detect pdumper and --temacs invocation; actually load
      portable dump when detected; set gflags as appropriate; changes to
      init functions throughout to avoid passing explicit
      'initialized' argument.
      * src/eval.c (inhibit_lisp_code): remove unused variable.
      (init_eval_once_for_pdumper): new function.
      (init_eval_once): call it.
      * src/filelock.c: CANNOT_DUMP -> will_dump_p()
      * src/fingerprint-dummy.c: new file
      * src/fingerprint.h: new file
      * src/fns.c: CANNOT_DUMP -> will_dump_p(), etc.
      (weak_hash_tables): remove
      (hashfn_equal, hashfn_eql): un-staticify
      (make_hash_table): set new 'next_weak' hash table field; drop
      global weak_hash_tables logic.
      (copy_hash_table): drop global weak_hash_tables logic.
      (hash_table_rehash): new function.
      (hash_lookup, hash_put, hash_remove_from_table, hash_clear):
      rehash if needed.
      (sweep_weak_table): un-staticify; explain logic; bool-ify.
      (sweep_weak_hash_tables): remove function.
      * src/font.c (syms_of_font): remember pdumper stuff.
      * src/fontset.c (syms_of_fontset): remember pdumper stuff.
      * src/frame.c (make_initial_frame): don't reset Vframe_list.
      (init_frame_once_for_pdumper, init_frame_once): new functions.
      (syms_of_frame): remove redundant staticpro.
      * src/fringe.c (init_fringe_once_for_pdumper): new functin.
      (init_fringe_once): call it.
      * src/ftcrfont.c (syms_of_ftcrfont_for_pdumper): new function.
      (syms_of_ftcrfont): call it.
      * src/ftfont.c (syms_of_ftfont_for_pdumper): new function.
      (syms_of_ftfont): call it.
      * src/ftxont.c (syms_of_ftxfont_for_pdumper): new function.
      (syms_of_ftxfont): call it.
      * src/gmalloc.c: adjust for pdumper througout
      (DUMPED): remove weird custom dumped indicator.
      * src/gnutls.c (syms_of_gnutls): pdumper note for
      gnutls_global_initialized.
      * src/image.c (syms_of_image): add pdumper comment,
      initializer note.
      * src/insdel.c (prepare_to_modify_buffer_1): account
      for buffer contents possibly being in dump image.
      * src/keyboard.c (syms_of_keyboard_for_pdumper): new function.
      (syms_of_keyboard): staticpro more; call pdumper syms function.
      * src/lisp.h: add comments throughout
      (gflags): declare.
      (will_dump_p, will_bootstrap_p, will_dump_with_pdumper_p)
      (dumped_with_pdumper_p, will_dump_with_unexec_p)
      (dumped_with_unexec_p, definitely_will_not_unexec_p): new
      functions.
      (POWER_OF_2, ROUNDUP): move macros.
      (PSEUDOVECTOR_TYPE, PSEUDOVECTOR_TYPEP): take vectorlike header
      pointer instead of vector; constify.
      (Lisp_Hash_Table): add comment about need to rehash on access; add
      comment for next_weak.
      (HASH_KEY, HASH_VALUE, HASH_HASH, HASH_TABLE_SIZE): const-ify.
      (hash_table_rehash): declare.
      (hash_rehash_needed_p, hash_rehash_if_needed): new functions.
      (finalizers, doomed_finalizers): declare extern.
      (SUBR_SECTION_ATTRIBUTE): new macro.
      (staticvec, staticidx): un-static-ify.
      (sweep_weak_hash_tables): remove declaration.
      (sweep_weak_table): declare.
      (hashfn_eql, hashfn_equal): declare.
      (number_finalizers_run): new variable.
      (Vdead): externify when ENABLE_CHECKING.
      (gc_root_type): new enumeration.
      (gc_root_visitor): new struct.
      (visit_static_gc_roots): declare.
      (vectorlike_nbytes): declare.
      (vector_nbytes): define as trivial inline function wrapper for
      vectorlike_nbytes.
      (init_obarray_once): change signature.
      (primary_thread): extern-ify.
      (init_buffer): change signature.
      (init_frame_once): declare.
      * src/lread.c (readevalloop): adjust for new dumped predicates.
      (init_obarray_once): new function.
      (ndefsubr): new variable.
      (defsubr): increment it.
      (load_path_check): adjust for pdumper.
      (load_path_default): use pdumper functions; adjust for
      dump search.
      * src/macfont.m (macfont_init_font_change_handler): avoid
      shadowing global.
      (syms_of_macfont_for_pdumper): new function.
      (syms_of_macfont): call it.
      * src/menu.c (syms_of_menu): staticpro more stuff.
      * src/minibuf.c (Ftry_completion): rehash if needed.
      (init_minibuf_once_for_pdumper): new function.
      (init_minibuf_once): call it.
      * src/nsfont.m (syms_of_nsfns): staticpro more.
      * src/nsfont.m (syms_of_nsfont_for_pdumper): new function.
      (syms_of_nsfont): call it.
      * src/nsterm.m (syms_of_nsfont): remember pdumper stuff.
      * src/pdumper.c: new file.
      * src/pdumper.h: new file.
      * src/process.c (init_process_emacs): use new pdumper functions
      instead of CANNOT_DUMP.
      * src/profiler.c (syms_of_profiler_for_pdumper): new function.
      (syms_of_profiler_for_pdumper): call it.
      * src/search.c (syms_of_search_for_pdumper): new function.
      (syms_of_search_for_pdumper): call it.
      * src/sheap.c (bss_sbrk_did_unexec): remove.
      * src/sheap.h (bss_sbrk_did_unexec): remove.
      * src/syntax.c (syms_of_syntax): don't redundantly staticpro
      re_match_object.
      * src/sysdep.c: use will_dump_with_unexec_p() instead of bss
      hack thing.
      * src/syssignals.h (init_sigsegv): declare.
      * src/systime.h (init_timefns): remove bool from signature.
      * src/textprop.c (syms_of_textprop): move staticpro.
      * src/thread.c (main_thread_p): constify.
      * src/thread.h (main_thread_p): constify.
      * src/timefns.c (init_timefns): remove bool from signature.
      (syms_of_timefns_for_pdumper): new function.
      (syms_of_timefns): call it.
      * src/w32.c: rearrange code.
      * src/w32.h (w32_relocate): declare.
      * src/w32fns.c (syms_of_w32fns): add pdumper note.
      * src/w32font.c (syms_of_w32font_for_pdumper): new function.
      (syms_of_w32font): call it.
      * src/w32heap.c (using_dynamic_heap): new variable.
      (init_heap): use it.
      * src/w32menu.c (syms_of_w32menu): add pdumper note.
      * src/w32proc.c
      (ctrl_c_handler, mainCRTStartup, _start, open_input_file)
      (rva_to_section, close_file_data): move here.
      * src/w32uniscribe.c (syms_of_w32uniscribe_for_pdumper):
      new function.
      (syms_of_w32uniscribe): call it.
      * src/window.c (init_window_once_for_pdumper): new function.
      (init_window_once): call it; staticpro more stuff.
      * src/xfont.c (syms_of_xfont_for_pdumper): new function.
      (syms_of_xfont): call it.
      * src/xftfont.c (syms_of_xftfont_for_pdumper): new function.
      (syms_of_xftfont): call it.
      * src/xmenu.c (syms_of_xmenu_for_pdumper): new function.
      (syms_of_xmenu): call it.
      * src/xselect.c (syms_of_xselect_for_pdumper): new function.
      (syms_of_xselect): call it.
      * src/xsettings.c (syms_of_xsettings): add more pdumper notes.
      * src/term.c (syms_of_xterm): add pdumper note.
      
      * src/dispnew.c (init_faces_initial): new function.
      (init_display_interactive): rename from init_display; use
      will_dump_p instead of !initialized.  Initialize faces early for
      pdumper if needed.
      (init_display): new function.
      (syms_of_display_for_pdumper): new function.
      (syms_of_display): call it.
      
      * src/dbusbind.c (syms_of_dbusbind): Add TODO for bus reset
      on pdumper load.
      
      * src/data.c (Fdefalias): Use will_dump_p
      instead of Vpurify_flag.
      (Fmake_variable_buffer_local): silence compiler warning with -Og
      by making valcontents UNINIT.
      (arith_driver): silence compiler warning with UNINIT.
      
      * src/conf_post.h (ATTRIBUTE_SECTION): new macro.
      
      * src/composite.c (composition_gstring_put_cache): rehash hash
      table if needed.
      
      * src/coding.c (init_coding_once, syms_of_coding): remember
      pdumper stuff.
      
      * src/charset.h (charset_table_size, charset_table_user): declare.
      
      * src/charset.c (charset_table_used, charset_table_size): un-static.
      (init_charset_oncem, syms_of_charset): remember pdumper stuff.
      
      * src/category.c (category_table_version): remove obsolete
      variable.
      
      * src/callint.c (syms_of_callint): staticpro 'preserved_fns'
      (init_callproc): use will_dump_p instead of !CANNOT_DUMP.
      
      * src/bytecode.c (exec_byte_code): rehash table tables if needed
      
      * src/buffer.c (alloc_buffer_text, free_buffer_text): account for
      pdumper
      (init_buffer_once): add TODO; remember stuff for pdumper.
      (init_buffer): don't take initialized argument; adjust
      for pdumper.
      
      * src/atimer.c (init_atimer): initialize subr only if
      !initialized.
      
      * src/alloc.c: (vector_marked_p, set_vector_marked)
      (vectorlike_marked_p, set_vectorlike_marked, cons_marked_p)
      (set_cons_marked, string_marked_p, set_string_marked)
      (symbol_marked_p, set_symbol_marked, interval_marked_p)
      (set_interval_marked): new accessor routines.  Use them
      instead of raw GC access throughout.
      (Vdead): make non-static when ENABLE_CHECKING.
      (vectorlike_nbytes): rename of 'vector_nbytes'; take a vectorlike
      header as input instead of a vector.
      (number_finalizers_run): new internal C variable.
      (mark_maybe_object): check for pdumper objects.
      (valid_pointer_p): don't be gratuitously inefficient under rr(1).
      (make_pure_c_string): add support for size_byte = -2 mode
      indicating that string data points into Emacs image rodata.
      (visit_vectorlike_root): visits GC roots embedded in
      vectorlike objects.
      (visit_buffer_root): visits GC roots embedded in
      our totally-not-a-buffer buffer global objects.
      (visit_static_gc_roots): visit GC roots in the Emacs data section.
      (mark_object_root_visitor): root callback used for conventional GC
      marking
      (weak_hash_tables): new internal variable for tracking found weak
      hash tables during GC.
      (mark_and_sweep_weak_table_contents): new weak hash table marking.
      (garbage_collect_1): use new GC root visitor machinery.
      (mark_vectorlike): accept a vectorlike_header instead of a
      Lisp_Vector.
      (mark_frame, mark_window, mark_hash_table): new functions.
      (mark_object): initialize 'm'; check for pdumper objects and use
      new mark-bit accessors throughout.  Remove some object-specific
      marking code and move to helper functions above.
      (survives_gc_p): check for pdumper objects.
      (gc-sweep): clear pdumper mark bits.
      (init_alloc_once_for_pdumper): new helper function for early init
      called both during normal init and pdumper load.
      (init_alloc_once): pdumper integration.
      
      * src/Makefile.in: Rewrite dumping for pdumper; add pdumper.o;
      invoke temacs with --temacs command line option; build dmpstruct.h
      from dmpstruct.awk; stop relying on CANNOT_DUMP; clean up pdumper
      intermediate files during build.
      
      * nextstep/Makefile.in: build emacs.pdmp into NS packages
      
      * lisp/startup.el: account for new '--temacs' and '--dump-file'
      command line option.
      
      * lisp/loadup.el: rewrite early init to account for pdumper; use
      injected 'dump-mode' variable (set via the new '--temacs' option)
      instead of parsing command line.
      
      * lisp/cus-start.el: Check 'dump-mode' instead of 'purify-flag',
      since the new 'dump-mode'
      
      * lib-src/make-fingerprint.c: new program
      
      * lib-src/Makefile.in: built make-fingerprint utility program
      
      * configure.ac: Add --with-pdumper toggle to control pdumper
      support; add --with-unexec toggle to control unexec support.
      Add --with-dumping option to control which dumping strategy we use
      by default.  Adjust for pdumper throughout.  Check for
      posix_madvise.
      
      * Makefile.in: Add @DUMPING@ substitution; add pdumper mode.
      
      * .gitignore: Add make-fingerprint, temacs.in, fingerprint.c,
      dmpstruct.h, and pdumper dump files.
      d12e5d00
  13. 01 Jan, 2019 1 commit
  14. 13 Oct, 2018 1 commit
    • Eli Zaretskii's avatar
      Fix redisplay of glyphless characters · e724a8f6
      Eli Zaretskii authored
      * src/conf_post.h (bool_bf): Use 'unsigned int' in the MinGW
      builds.  Suggested by Tom Tromey <tom@tromey.com>.  (Bug#33017)
      * src/dispnew.c (scrolling_window): Update commentary
      regarding xwidget builds.
      e724a8f6
  15. 28 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Modularize bignums better · 9abaf5f3
      Paul Eggert authored
      * src/bignum.c, src/bignum.h: New files.  Only modules that
      need to know how bignums are implemented should include
      bignum.h.  Currently these are alloc.c, bignum.c (of course),
      data.c, emacs.c, emacs-module.c, floatfns.c, fns.c, print.c.
      * src/Makefile.in (base_obj): Add bignum.o.
      * src/alloc.c (make_bignum_str): Move to bignum.c.
      (make_number): Remove; replaced by bignum.c’s make_integer.
      All callers changed.
      * src/conf_post.h (ARG_NONNULL): New macro.
      * src/json.c (json_to_lisp): Use it.
      * src/data.c (Fnatnump):
      Move NATNUMP’s implementation here from lisp.h.
      * src/data.c (Fnumber_to_string):
      * src/editfns.c (styled_format):
      Move conversion of string to bignum to bignum_to_string, and
      call it here.
      * src/emacs-module.c (module_make_integer):
      * src/floatfns.c (Fabs):
      Simplify by using make_int.
      * src/emacs.c: Include bignum.h, to expand its inline fns.
      * src/floatfns.c (Ffloat): Simplify by using XFLOATINT.
      (rounding_driver): Simplify by using double_to_bignum.
      (rounddiv_q): Clarify use of temporaries.
      * src/lisp.h: Move decls that need to know bignum internals to
      bignum.h.  Do not include gmp.h or mini-gmp.h; that is now
      bignum.h’s job.
      (GMP_NUM_BITS, struct Lisp_Bignum, XBIGNUM, mpz_set_intmax):
      Move to bignum.h.
      (make_int): New function.
      (NATNUMP): Remove; all callers changed to use Fnatnump.
      (XFLOATINT): If arg is a bignum, use bignum_to_double, so that
      bignum internals are not exposed here.
      * src/print.c (print_vectorlike): Use SAFE_ALLOCA to avoid the
      need for a record_unwind_protect_ptr.
      9abaf5f3
  16. 12 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Make mini-gmp safe for --enable-gcc-warnings · d966f8d2
      Paul Eggert authored
      * configure.ac (GMP_OBJ): When building mini-gmp, compile
      mini-gmp-emacs.c, not mini-gmp.c.
      * lib-src/etags.c (NDEBUG): Don't attempt to redefine, in
      case the builder compiles with -DNDEBUG.
      * src/conf_post.h (NDEBUG) [!ENABLE_CHECKING && !NDEBUG]: Define.
      This avoids bloat in mini-gmp-emacs.o.
      * src/mini-gmp-emacs.c: New file, which pacifies --enable-gcc-warnings.
      d966f8d2
  17. 06 Aug, 2018 2 commits
    • Paul Eggert's avatar
      Use Gnulib regex for lib-src · d904cc83
      Paul Eggert authored
      Emacs regular expressions forked from everyone else long ago.
      This makes it official and should allow simplification later.
      etags.c now uses the glibc regex API, falling back on a
      Gnulib-supplied substitute lib/regex.c if necessary.
      Emacs proper now uses its own regular expression module.
      Although this patch may look dauntingly large, most of it
      was generated automatically by admin/merge-gnulib
      and contains an exact copy of the glibc regex source,
      and the by-hand changes do not grow the Emacs source code.
      * admin/merge-gnulib (GNULIB_MODULES): Add regex.
      (AVOIDED_MODULES): Add btowc, langinfo, lock, mbrtowc, mbsinit,
      nl_langinfo, wchar, wcrtomb, wctype-h.
      * lib-src/Makefile.in (regex-emacs.o): Remove; Gnulib does it now.
      (etags_deps, etags_libs): Remove regex-emacs.o.
      * lib-src/etags.c: Go back to including regex.h.
      (add_regex): Use unsigned char translation array,
      since glibc regex requires that.
      * lib/Makefile.in (not_emacs_OBJECTS, for_emacs_OBJECTS): New macros.
      (libegnu_a_OBJECTS): Use them, to avoid building e-regex.o.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/regcomp.c, lib/regex.c, lib/regex.h, lib/regex_internal.c:
      * lib/regex_internal.h, lib/regexec.c, m4/builtin-expect.m4:
      * m4/eealloc.m4, m4/glibc21.m4, m4/mbstate_t.m4, m4/regex.m4:
      New files, copied from Gnulib.
      * src/regex-emacs.h, src/conf_post.h:
      (RE_TRANSLATE_TYPE, RE_TRANSLATE, RE_TRANSLATE_P):
      Move from src/conf_post.h to src/regex-emacs.h,
      so that they don’t interfere with compiling lib/regex.c.
      d904cc83
    • Paul Eggert's avatar
      Rename src/regex.c to src/regex-emacs.c. · e5652268
      Paul Eggert authored
      This is in preparation for using Gnulib regex for etags,
      to avoid collisions in include directives.
      * src/regex-emacs.c: Rename from src/regex.c.
      * src/regex-emacs.h: Rename from src/regex.h.  All uses changed.
      * test/src/regex-emacs-tests.el: Rename from test/src/regex-tests.el.
      e5652268
  18. 13 Jul, 2018 1 commit
    • Tom Tromey's avatar
      Rename integerp->fixnum, etc, in preparation for bignums · 42fe787b
      Tom Tromey authored
      * src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c,
      src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c,
      src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c,
      src/process.c, src/profiler.c, src/search.c, src/sound.c,
      src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c,
      src/textprop.c, src/undo.c, src/w16select.c, src/w32.c,
      src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c,
      src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c,
      src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c,
      src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c,
      src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename
      INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM,
      make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP,
      NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
      42fe787b
  19. 10 Jun, 2018 1 commit
    • Paul Eggert's avatar
      Use native alignment to access Lisp object data · 0303fab3
      Paul Eggert authored
      Instead of using __builtin_assume_aligned (P, GCALIGNMENT) to
      tell GCC that P has alignment 8, use (T *) P where T is the
      type of the pointed-to object, to tell GCC that P has native
      alignment.  This is simpler, matches the intent better, and
      should help simplify future improvements.  Some of these
      changes are to pacify gcc -Wnull-dereference, since GCC is
      smarter about pointers now that Emacs no longer uses
      __builtin_assume_aligned; these minor changes should improve
      code efficiency slightly.  On Fedora 28 x86-64 with default
      optimization this patch shrinks the size of the Emacs text
      segment by 0.36%.
      * src/conf_post.h (__has_builtin, __builtin_assume_aligned):
      Remove; no longer used.
      * src/dbusbind.c (XD_OBJECT_TO_DBUS_TYPE):
      Pacify -Wnull-dereference by using XCAR instead of CAR_SAFE
      and XCDR instead of CDR_SAFE when this is safe.
      * src/fileio.c (Fexpand_file_name):
      * src/font.c (clear_font_cache):
      Pacify -Wnull-dereference by removing unnecessary NILP test.
      * src/keyboard.c (xevent_start): New function.
      (read_char, read_key_sequence): Pacify -Wnull-dereference by
      using xevent_start instead of EVENT_START.
      * src/lisp.h (lisp_h_XUNTAG): Remove; XUNTAG is always a macro
      now, since it can no longer be implemented as a function.
      (XUNTAG): New third argument CTYPE.  All uses changed.
      Cast result to CTYPE * instead of using __builtin_assume_aligned.
      Simplify by using LISP_WORD_TAG.
      (LISP_WORD_TAG): New macro.
      (TAG_PTR): Use it.
      * src/menu.c (x_popup_menu_1):
      Pacify -Wnull-dereference by using XCAR instead of Fcar and
      XCDR instead of Fcdr where this is safe.
      0303fab3
  20. 09 Jun, 2018 1 commit
  21. 18 May, 2018 1 commit
    • Paul Eggert's avatar
      Port to GCC 8 -fsanitize=undefined · a1c925fd
      Paul Eggert authored
      In GCC 8, gcc -fsanitize=undefined flags the undefined behavior
      that Emacs relies on in its XPNTR and XSYMBOL low-level functions.
      Disable undefined sanitization in these functions.  Although this
      disabling doesn’t suffice if DEFINE_KEY_OPS_AS_MACROS is true, it
      works for -fsanitize=undefined -DINLINING=0, which is good enough.
      * src/alloc.c (macro_PNTR_ADD): New macro.
      (PNTR_ADD): New function and macro.
      The function disables -fsanitize=undefined.
      (macro_XPNTR): Use it.
      * src/conf_post.h (ATTRIBUTE_NO_SANITIZE_UNDEFINED): New macro.
      * src/lisp.h (XSYMBOL): Disable -fsanitize=undefined.
      a1c925fd
  22. 04 Apr, 2018 1 commit
    • Paul Eggert's avatar
      Pacify GCC when --enable-profiling · 9b0e8a4c
      Paul Eggert authored
      * src/conf_post.h (PROFILING): Undef if not on a platform that
      supports it.  Simplify uses accordingly.
      * src/emacs.c (etext) [PROFILING]:
      Declare at top level to avoid GCC warning.
      9b0e8a4c
  23. 01 Jan, 2018 1 commit
  24. 18 Oct, 2017 1 commit
    • Eli Zaretskii's avatar
      Fix the MSDOS build. · 2f7163fb
      Eli Zaretskii authored
      * msdos/sed1v2.inp (GETADDRINFO_A_LIBS, LIBLCMS2, XDBE_LIBS)
      (XDBE_FLAGS, HYBRID_MALLOC, LIBSYSTEMD_CFLAGS)
      (LIBSYSTEMD_LIBS): Edit to empty.
      (LIBRESOLV, DEPFLAGS, MKDEPDIR, YMF_PASS_LDFLAGS)
      (PRE_EDIT_LDFLAGS, POST_EDIT_LDFLAGS): Remove editing.
      Remove editing of lines that are no longer present in
      src/Makefile.in.
      * msdos/sed2v2.inp (NEED_MKTIME_INTERNAL)
      (NEED_MKTIME_WORKING): Define to 1.
      (HAVE_STRUCT_DIRENT_D_TYPE): Define to 1 for
      DJGPP >= 2.05.
      (HAVE_STRUCT_ATTRIBUTE_ALIGNED): Define to 1.
      Define PACKAGE_VERSION, not VERSION.
      (FLEXIBLE_ARRAY_MEMBER): Define to empty.
      (HAVE_DECL_*_UNLOCKED): Define to 0.
      (HAVE___BUILTIN_FRAME_ADDRESS): Define to 1.
      (PENDING_*): Don't define, as Gnulib no longer supports that.
      Instead, define _IOERR as it is in libc/file.h.
      * msdos/sed3v2.inp: Use $(CURDIR) instead of $(shell cd) to
      determine the current directory.
      (UPDATE_MANIFEST, UTILITIES): Don't edit.
      * msdos/sedlisp.inp (FIND_DELETE): Edit to "-delete".
      * msdos/sedlibmk.inp (AUTO_DEPEND): Define to yes.
      (HYBRID_MALLOC): Edit to empty.
      (am__cd): Don't edit.
      (../config.status): Replaces $(top_builddir)/config.status.
      Define OMIT_GNULIB_MODULE_foo = true for modules not built for
      MS-DOS.  Convert GL_GENERATE_xxx_H_TRUE and
      GL_GENERATE_xxx_H_FALSE into values of GL_GENERATE_xxx_H.
      * msdos/mainmake.v2 (src): Use 'compile-one-process', and make
      the command line shorter to fit into 126-char limit of
      command.com.
      * config.bat: Generate src/deps/*.d files.  Rename more files
      like djtar on plain DOS would.
      Don't rename src/dir.h: it is long gone.  Edit
      lib/gnulib.mk.in using the same scripts as for
      lib/Makefile.in.
      * msdos/depfiles.bat: Create *.d files, not *.Po.
      
      * src/thread.c (Fmake_thread) [!THREADS_ENABLED]: Improve the
      error message.
      * src/thread.h [MSDOS]: Include <signal.h>.
      * src/sysselect.h (select) [MSDOS]: Undefine, to avoid
      compilation errors.
      * src/sysdep.c (block_interrupt_signal, restore_signal_mask):
      Expose to MSDOS build.
      * src/process.c (update_processes_for_thread_death)
      [!subprocess]: No-op implementation.
      [HAVE_SETRLIMIT]: Move inclusion of sys/resource.h and
      declaration of nofile_limit outside "#ifdef subprocesses", as
      it's needed for MSDOS.
      * src/msdos.c (faccessat): Declare fullname[].
      * src/msdos.h (ENOTSUP): Define to be identical to ENOSYS.
      Include termhooks.h.
      * src/conf_post.h [WINDOWSNT]: Include ms-w32.h only on
      WINDOWSNT, not DOS_NT.
      
      * admin/admin.el (set-version): Set version on PACKAGE_VERSION.
      2f7163fb
  25. 28 Sep, 2017 2 commits
  26. 14 Sep, 2017 1 commit
  27. 13 Sep, 2017 1 commit
    • Paul Eggert's avatar
      Prefer HTTPS to FTP and HTTP in documentation · bc511a64
      Paul Eggert authored
      Most of this change is to boilerplate commentary such as license URLs.
      This change was prompted by ftp://ftp.gnu.org's going-away party,
      planned for November.  Change these FTP URLs to https://ftp.gnu.org
      instead.  Make similar changes for URLs to other organizations moving
      away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
      fsf.org when this works, as this will further help defend against
      man-in-the-middle attacks (for this part I omitted the MS-DOS and
      MS-Windows sources and the test tarballs to keep the workload down).
      HTTPS is not fully working to lists.gnu.org so I left those URLs alone
      for now.
      bc511a64
  28. 14 Jun, 2017 2 commits
    • Paul Eggert's avatar
      Port cleanup check to Oracle Studio 12.5 · d715e6d8
      Paul Eggert authored
      * src/conf_post.h (__has_attribute_cleanup): Resurrect.
      * src/emacs-module.c: Verify __has_attribute (cleanup), but in an
      #if this time.
      d715e6d8
    • Paul Eggert's avatar
      Port cleanup attribute to Oracle Studio 12.5 · 27bb4de7
      Paul Eggert authored
      * INSTALL (--with-modules): List cleanup attribute as prereq.
      * src/conf_post.h (__has_attribute_cleanup): Remove; no longer needed.
      * src/emacs-module.c (MODULE_SETJMP_1): Don’t attempt to verify
      (__has_attribute (cleanup)), as Oracle Studio 12.5 supports
      __has_attribute only inside preprocessor expressions.  The C
      compiler should check the cleanup attribute in the next line anyway.
      (module_reset_handlerlist): Remove an unnecessary ‘const’
      that causes Oracle Studio 12.5 to refuse to compile.
      27bb4de7
  29. 25 May, 2017 1 commit
    • Paul Eggert's avatar
      Port ATTRIBUTE_MAY_ALIAS to recent icc · d7284da8
      Paul Eggert authored
      * src/conf_post.h (ATTRIBUTE_MAY_ALIAS) [__ICC]:
      Define to empty.  Otherwise, icc (ICC) 17.0.4 20170411 says
      “warning #2621: attribute "__may_alias__" does not apply here”
      for constructs like ‘struct sockaddr *sa = (whatever);
      struct sockaddr_in __attribute__ ((__may_alias__)) *sin
      = (struct sockaddr_in *) sa;’.
      d7284da8
  30. 17 May, 2017 2 commits
  31. 16 May, 2017 1 commit
    • Paul Eggert's avatar
      Merge with gnulib, pacifying GCC 7 · 2e1bebe2
      Paul Eggert authored
      This incorporates:
      2017-05-16 manywarnings: update for GCC 7
      2017-05-15 sys_select: Avoid "was expanded before it was required"
      * configure.ac (nw): Suppress GCC 7’s new -Wduplicated-branches and
      -Wformat-overflow=2 options, due to too many false alarms.
      * doc/misc/texinfo.tex, lib/strftime.c, m4/manywarnings.m4:
      Copy from gnulib.
      * m4/gnulib-comp.m4: Regenerate.
      * src/coding.c (decode_coding_iso_2022):
      Fix bug uncovered by -Wimplicit-fallthrough.
      * src/conf_post.h (FALLTHROUGH): New macro.
      Use it to mark all switch cases that fall through.
      * src/editfns.c (styled_format): Use !, not ~, on bool.
      * src/gtkutil.c (xg_check_special_colors):
      When using sprintf, don’t trust Gtk to output colors in [0, 1] range.
      (xg_update_scrollbar_pos): Avoid use of possibly-uninitialized bool;
      this bug was actually caught by Clang.
      * src/search.c (boyer_moore):
      Tell GCC that CHAR_BASE, if nonzero, must be a non-ASCII character.
      * src/xterm.c (x_draw_glyphless_glyph_string_foreground):
      Tell GCC that glyph->u.glyphless.ch must be a character.
      2e1bebe2
  32. 18 Apr, 2017 1 commit
  33. 06 Apr, 2017 1 commit
    • Ken Raeburn's avatar
      Fix CANNOT_DUMP build on Darwin/macOS. · d15719d3
      Ken Raeburn authored
      * src/conf_post.h (malloc, realloc, free) [DARWIN_OS && emacs &&
      CANNOT_DUMP]: Don't define as unexec_malloc, etc.
      * src/emacs.c (main): Don't call unexec_init_emacs_zone.
      d15719d3
  34. 01 Jan, 2017 1 commit
  35. 06 Nov, 2016 1 commit
    • Paul Eggert's avatar
      Modernize usage of 'macOS' in doc and comments · dc152c54
      Paul Eggert authored
      Apple changed the spelling of its operating system again, to "macOS",
      effective with macOS 10.12 Sierra (2016-09-20).  Change Emacs
      documentation and comments to match this.  Stick with older OS
      spellings ("OS X", "Mac OS X") when talking about older releases where
      the older names are more correct.
      dc152c54
  36. 12 Oct, 2016 1 commit
    • Paul Eggert's avatar
      Port --enable-gcc-warnings to GCC 6.2.1 · eb17d6f5
      Paul Eggert authored
      Backport from master.
      * src/conf_post.h (GNUC_PREREQ): New macro.
      * src/keyboard.c: Use it to work around GCC bug 54561.
      * src/process.c (would_block): New function.
      (server_accept_connection, wait_reading_process_output, send_process):
      Use it.
      eb17d6f5