aboutsummaryrefslogtreecommitdiffstats
path: root/src/ChangeLog
diff options
context:
space:
mode:
authorPaul Eggert2011-03-17 09:51:42 -0700
committerPaul Eggert2011-03-17 09:51:42 -0700
commita3a6c54ec72118e8d22d2ecd608df5193c8926a3 (patch)
treede018428bd736fd37ec25ac07152199664d3f08b /src/ChangeLog
parentd6cd56f187a791983579bf5d4ce3702d2ddf2499 (diff)
parentb1d876f1a19ae65c8a8dd61c4ce17055ca53f16c (diff)
downloademacs-a3a6c54ec72118e8d22d2ecd608df5193c8926a3.tar.gz
emacs-a3a6c54ec72118e8d22d2ecd608df5193c8926a3.zip
Merge: Fix more problems found by GCC 4.5.2's static checks.
Diffstat (limited to 'src/ChangeLog')
-rw-r--r--src/ChangeLog314
1 files changed, 314 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c43d3ba95ec..d97969c24db 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,317 @@
12011-03-17 Paul Eggert <eggert@cs.ucla.edu>
2
3 Fix more problems found by GCC 4.5.2's static checks.
4
5 * process.c (make_serial_process_unwind, send_process_trap):
6 (sigchld_handler): Now static.
7
8 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
9 That way, the code declares only the vars that it needs.
10 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
11 * s/cygwin.h (PTY_ITERATION): Likewise.
12 * s/darwin.h (PTY_ITERATION): Likewise.
13 * s/gnu-linux.h (PTY_ITERATION): Likewise.
14
15 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16 * process.c (allocate_pty): Don't declare stb unless it's needed.
17
18 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
19 (CONSTANTLIM): Remove; unused.
20 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
21 Define only if needed.
22
23 * unexelf.c (unexec): Name an expression,
24 to avoid gcc -Wbad-function-cast warning.
25 Use a different way to cause a compilation error if anyone uses
26 n rather than nn, a way that does not involve shadowing.
27 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
28
29 * deps.mk (unexalpha.o): Remove; unused.
30
31 New file unexec.h, the (simple) interface for unexec (Bug#8267).
32 * unexec.h: New file.
33 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
34 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
35 Depend on unexec.h.
36 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
37 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
38 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
39
40 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
41 shadowing.
42 (back_comment, skip_chars): Mark vars as initialized.
43
44 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
45 Rename locals to avoid shadowing.
46
47 * lread.c (read1): Rewrite so as not to use empty "else".
48 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
49
50 * print.c (Fredirect_debugging_output): Fix pointer signedess.
51
52 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
53 warning when compiling print.c.
54
55 * font.c (font_unparse_fcname): Abort in an "impossible" situation
56 instead of using an uninitialized var.
57 (font_sort_entities): Mark var as initialized.
58
59 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
60
61 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
62 pointers to constants.
63 (font_parse_fcname): Remove unused vars.
64 (font_delete_unmatched): Now static.
65 (font_get_spec): Remove; unused.
66 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
67 (font_update_drivers, Ffont_get_glyphs, font_add_log):
68 Rename or move locals to avoid shadowing.
69
70 * fns.c (require_nesting_list, require_unwind): Now static.
71 (Ffillarray): Rename locals to avoid shadowing.
72
73 * floatfns.c (domain_error2): Define only if needed.
74 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
75
76 * alloc.c (mark_backtrace): Move decl from here ...
77 * lisp.h: ... to here, so that it can be checked.
78
79 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
80 (Fdefvar): Rewrite so as not to use empty "else".
81 (lisp_indirect_variable): Name an expression,
82 to avoid gcc -Wbad-function-cast warning.
83 (Fdefvar): Rename locals to avoid shadowing.
84
85 * callint.c (quotify_arg, quotify_args): Now static.
86 (Fcall_interactively): Rename locals to avoid shadowing.
87 Use const pointer when appropriate.
88
89 * lisp.h (get_system_name, get_operating_system_release):
90 Move decls here, to check interfaces.
91 * process.c (get_operating_system_release): Move decl to lisp.h.
92 * xrdb.c (get_system_name): Likewise.
93 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
94 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
95 some of which prompt warnings from gcc -Wbad-function-cast.
96 (Fformat_time_string, Fencode_time, Finsert_char):
97 (Ftranslate_region_internal, Fformat):
98 Rename or remove local vars to avoid shadowing.
99 (Ftranslate_region_internal): Mark var as initialized.
100
101 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
102 avoid shadowing.
103
104 * lisp.h (eassert): Check that the argument compiles, even if
105 ENABLE_CHECKING is not defined.
106
107 * data.c (Findirect_variable): Name an expression, to avoid
108 gcc -Wbad-function-cast warning.
109 (default_value, arithcompare, arith_driver, arith_error): Now static.
110 (store_symval_forwarding): Rename local to avoid shadowing.
111 (Fmake_variable_buffer_local, Fmake_local_variable): Mark
112 variables as initialized.
113 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
114
115 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
116 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
117 Rename locals to avoid shadowing.
118 (mark_stack): Move local variables into the #ifdef region where
119 they're used.
120 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
121 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
122 needed otherwise.
123 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
124 (GC_STRING_CHARS): Remove; not used.
125 (Fmemory_limit): Cast sbrk's returned value to char *.
126
127 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
128 avoids undefined behavior in theory.
129
130 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
131
132 Use functions, not macros, for up- and down-casing (Bug#8254).
133 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
134 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
135 to use the following functions instead of these macros.
136 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
137 EMACS_INT, since callers assume the returned value fits in int.
138 (upcase1): Likewise, for UPCASE_TABLE.
139 (uppercasep, lowercasep, upcase): New static inline functions.
140 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
141 the race-condition problem in the old DOWNCASE.
142
143 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
144 Rename locals to avoid shadowing.
145 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
146 (regex_compile, re_search_2, re_match_2_internal):
147 Remove unused local vars.
148 (FREE_VAR): Rewrite so as not to use empty "else",
149 which gcc can warn about.
150 (regex_compile, re_match_2_internal): Mark locals as initialized.
151 (RETALLOC_IF): Define only if needed.
152 (WORDCHAR_P): Likewise. This one is never needed, but is used
153 only in a comment talking about a compiler bug, so put inside
154 the #if 0 of that comment.
155 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
156 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
157 Remove; unused.
158
159 * search.c (boyer_moore): Rename locals to avoid shadowing.
160 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
161 (PREV_CHAR_BOUNDARY): Likewise.
162
163 * search.c (simple_search): Remove unused var.
164
165 * dired.c (compile_pattern): Move decl from here ...
166 * lisp.h: ... to here, so that it can be checked.
167 (struct re_registers): New forward decl.
168
169 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
170
171 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
172 All uses changed.
173 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
174 Rename locals to avoid shadowing.
175 (Fvertical_motion): Mark locals as initialized.
176
177 * casefiddle.c (casify_object, casify_region): Now static.
178 (casify_region): Mark local as initialized.
179
180 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
181
182 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
183 New macros, so that the caller can use some names other than
184 gcpro1, gcpro2, etc.
185 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
186 of the new macros.
187 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
188 argument, for consistency with GCPRO2_VAR, etc: it is now the
189 prefix of the variable, not the variable itself. All uses
190 changed.
191 * dired.c (directory_files_internal, file_name_completion):
192 Rename locals to avoid shadowing.
193
194 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
195 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
196 dired.c's scmp function, had undefined behavior.
197 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
198 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
199 * buffer.h: ... to here, because these macros use current_buffer,
200 and the new implementation with inline functions needs to have
201 current_buffer in scope now, rather than later when the macros
202 are used.
203 (downcase, upcase1): New static inline functions.
204 (DOWNCASE, UPCASE1): Reimplement using these functions.
205 This avoids undefined behavior in expressions like
206 DOWNCASE (x) == DOWNCASE (y), which previously suffered
207 from race conditions in accessing the global variables
208 case_temp1 and case_temp2.
209 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
210 * lisp.h (case_temp1, case_temp2): Remove their decls.
211 * character.h (ASCII_CHAR_P): Move from here ...
212 * lisp.h: ... to here, so that the inline functions mentioned
213 above can use them.
214
215 * dired.c (directory_files_internal_unwind): Now static.
216
217 * fileio.c (file_name_as_directory, directory_file_name):
218 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
219 Now static.
220 (file_name_as_directory): Use const pointers when appropriate.
221 (Fexpand_file_name): Likewise. In particular, newdir might
222 point at constant storage, so make it a const pointer.
223 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
224 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
225 signedness issues.
226 (Fset_file_times, Finsert_file_contents, auto_save_error):
227 Rename locals to avoid shadowing.
228
229 * minibuf.c (choose_minibuf_frame_1): Now static.
230 (Ftry_completion, Fall_completions): Rename or remove locals
231 to avoid shadowing.
232
233 * marker.c (bytepos_to_charpos): Remove; unused.
234
235 * lisp.h (verify_bytepos, count_markers): New decls,
236 so that gcc does not warn that these functions aren't declared.
237
238 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
239 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
240 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
241 (copy_text): Remove unused local var.
242
243 * filelock.c (within_one_second): Now static.
244 (lock_file_1): Rename local to avoid shadowing.
245
246 * buffer.c (fix_overlays_before): Mark locals as initialized.
247 (fix_start_end_in_overlays): Likewise. This function should be
248 simplified by using pointers-to-pointers, but that's a different
249 matter.
250 (switch_to_buffer_1): Now static.
251 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
252 (report_overlay_modification): Rename locals to avoid shadowing.
253
254 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
255 Fix pointer signedness issue.
256 (sys_subshell): Mark local as volatile if checking for lint,
257 to suppress a gcc -Wclobbered warning that does not seem to be right.
258 (MAXPATHLEN): Define only if needed.
259
260 * process.c (serial_open, serial_configure): Move decls from here ...
261 * systty.h: ... to here, so that they can be checked.
262
263 * fns.c (get_random, seed_random): Move extern decls from here ...
264 * lisp.h: ... to here, so that they can be checked.
265
266 * sysdep.c (reset_io): Now static.
267 (wait_for_termination_signal): Remove; unused.
268
269 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
270 (copy_keymap_item, append_key, push_text_char_description):
271 Now static.
272 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
273 (DENSE_TABLE_SIZE): Remove; unused.
274 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
275 (describe_map_tree):
276 Rename locals to avoid shadowing.
277
278 * keyboard.c: Declare functions static if they are not used elsewhere.
279 (echo_char, echo_dash, cmd_error, top_level_2):
280 (poll_for_input, handle_async_input): Now static.
281 (read_char, kbd_buffer_get_event, make_lispy_position):
282 (make_lispy_event, make_lispy_movement, apply_modifiers):
283 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
284 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
285 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
286 (read_key_sequence, read_char): Mark locals as initialized.
287 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
288
289 * keyboard.h (make_ctrl_char): New decl.
290 (mark_kboards): Move decl here ...
291 * alloc.c (mark_kboards): ... from here.
292
293 * lisp.h (force_auto_save_soon): New decl.
294
295 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
296 (DEFINE_DUMMY_FUNCTION): New macro.
297 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
298 Use it.
299 (main): Add casts to avoid warnings
300 if GCC considers string literals to be constants.
301
302 * lisp.h (fatal_error_signal): Add decl, since it's exported.
303
304 * dbusbind.c: Pointer signedness fixes.
305 (xd_signature, xd_append_arg, xd_initialize):
306 (Fdbus_call_method, Fdbus_call_method_asynchronously):
307 (Fdbus_method_return_internal, Fdbus_method_error_internal):
308 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
309 (Fdbus_register_signal): Use SSDATA when the context wants char *.
310
311 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
312 if GCC considers string literals to be constants.
313 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
314
12011-03-16 Stefan Monnier <monnier@iro.umontreal.ca> 3152011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
2 316
3 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro. 317 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.