* lisp.h (message, message_nolog, doprint, error, verror, fatal):
[bpt/emacs.git] / src / ChangeLog
index 269ab7c..185d611 100644 (file)
@@ -1,8 +1,111 @@
-2011-04-02  Paul Eggert  <eggert@cs.ucla.edu>
+2011-04-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix more problems found by GCC 4.6.0's static checks.
+
+       * lisp.h (message, message_nolog, doprint, error, verror, fatal):
+       Mark as printf-like functions.
+
+       * xdisp.c (vmessage): Mark as a printf-like function.
+
+       * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
+
+       * sound.c (sound_warning): Don't crash if arg contains a printf format.
+
+       * image.c (tiff_error_handler, tiff_warning_handler): Mark as
+       printf-like functions.
+       (tiff_load): Add casts to remove these marks before passing them
+       to system-supplied API.
+
+       * eval.c (Fsignal): Remove excess argument to 'fatal'.
+
+       * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
+       This avoids several warnings with gcc -Wstrict-overflow.
+       (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
+       directly, rather than having caller test rule sign.  This avoids
+       some unnecessary tests.
+       * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
+       (COMPOSITION_ENCODE_RULE): Arguments now must be valid.  This
+       affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
+
+       * xfont.c (xfont_text_extents): Remove var that was set but not used.
+       (xfont_open): Avoid unnecessary tests.
+
+       * composite.c (composition_gstring_put_cache): Use unsigned integer.
+
+       * composite.h, composite.c (composition_gstring_put_cache):
+       Use EMACS_INT, not int, for length.
+
+       * composite.h (COMPOSITION_DECODE_REFS): New macro,
+       breaking out part of COMPOSITION_DECODE_RULE.
+       (COMPOSITION_DECODE_RULE): Use it.
+       * composite.c (get_composition_id): Remove unused local vars,
+       by using the new macro.
+
+       * textprop.c (set_text_properties_1): Change while to do-while,
+       since the condition is always true at first.
+
+       * intervals.c (graft_intervals_into_buffer): Mark var as used.
+       (interval_deletion_adjustment): Return unsigned value.
+       All uses changed.
+
+       * process.c (list_processes_1, create_pty, read_process_output):
+       (exec_sentinel): Remove vars that were set but not used.
+       (create_pty): Remove unnecessary "volatile"s.
+       (Fnetwork_interface_info): Avoid possibility of int overflow.
+       (read_process_output): Do adaptive read buffering even if carryover.
+       (read_process_output): Simplify nbytes computation if buffered.
+
+       * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
+
+       * syntax.c (scan_words): Remove var that was set but not used.
+       (update_syntax_table): Use unsigned instead of int.
+
+       * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
+       (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
+       (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
+
+       * print.c (print_error_message): Avoid int overflow.
+
+       * font.c (font_list_entities): Redo for clarity,
+       so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
+
+       * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
+       (font_score): Avoid potential overflow in diff calculation.
+
+       * fns.c (substring_both): Remove var that is set but not used.
+       (sxhash): Redo loop for clarity and to avoid wraparound warning.
+
+       * eval.c (funcall_lambda): Rename local to avoid shadowing.
+
+       * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
+       Otherwise, GCC 4.6.0 optimizes the loop check away since the check
+       can always succeed if overflow has undefined behavior.
+
+       * search.c (boyer_moore, wordify): Remove vars set but not used.
+       (wordify): Omit three unnecessary tests.
+
+       * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
+       All callers changed.  This avoids the need for an unused var.
+
+       * casefiddle.c (casify_region): Remove var that is set but not used.
+
+       * dired.c (file_name_completion): Remove var that is set but not used.
+
+       * fileio.c (Finsert_file_contents): Make EOF condition clearer.
+
+       * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
+       (Finsert_file_contents): Remove unnecessary code checking fd.
+
+       * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
+       Check for integer overflow on size calculations.
+
+       * buffer.c (Fprevious_overlay_change): Remove var that is set
+       but not used.
 
        * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
        Remove vars that are set but not used.
        (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
+       (timer_check_2): Mark vars as initialized.
 
        * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
 
        * xselect.c (x_get_local_selection, x_handle_property_notify):
        Remove vars that are set but not used.
 
-2011-04-01  Paul Eggert  <eggert@cs.ucla.edu>
-
        * xfns.c (x_create_tip_frame): Remove var that is set but not used.
        (make_invisible_cursor): Initialize a possibly-uninitialized variable.
 
        * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
        ../lib/careadlinkat.h.
 
+2011-04-04  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
+       first non-nil return value).
+
+2011-04-03  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
+       if not defined (Bug#8403).
+
+2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
+
+       * xdisp.c (display_count_lines): Remove parameter `start',
+       unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
+       (get_char_face_and_encoding): Remove parameter `multibyte_p',
+       unused since 2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
+       (fill_stretch_glyph_string): Remove parameters `row' and `area',
+       unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
+       and thereabouts.  All callers changed.
+       (get_per_char_metric): Remove parameter `f', unused since
+       2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
+
+2011-04-02  Jim Meyering  <meyering@redhat.com>
+
+       do not dereference NULL upon failed strdup
+       * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
+       (ns_get_family): Likewise.
+
+2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
+
+       * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
+
+2011-04-02  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
+       later (Bug#8403).
+
 2011-04-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        Add lexical binding.