This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Fix most -Wmissing-prototypes -Wmissing-declarations warnings
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 18 Feb 2009 02:01:04 +0000
- Subject: Fix most -Wmissing-prototypes -Wmissing-declarations warnings
Hi,
With all the latest talk about declarations and prototypes, I got curious
and tried building GDB on x86_64-linux with `-Wmissing-declarations -Wmissing-prototypes'
added to WARN_CFLAGS, like so:
make WARN_CFLAGS="-Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wno-switch -Wno-char-subscripts -Wmissing-declarations -Wmissing-prototypes"
This revealed:
1) several functions that should be static
2) several cases of modules that don't include their own header
3) several cases of _initialize_foo not being declared.
4) a few functions that are public, declared, not never used.
I spent a few minutes fixing most of the cases that fit in
classes #1, #2 and #3 above.
For the record, here's the warning diff:
--- warnings_prev.txt 2009-02-17 23:57:18.000000000 +0000
+++ warnings_after.txt 2009-02-18 00:13:10.000000000 +0000
@@ -1,23 +1,5 @@
-../../src/gdb/solib.c:75: warning: no previous prototype for 'set_solib_ops'
-../../src/gdb/solib.c:482: warning: no previous prototype for 'solib_read_symbols'
-../../src/gdb/solib.c:720: warning: no previous prototype for 'solib_add'
-../../src/gdb/solib.c:859: warning: no previous prototype for 'solib_address'
-../../src/gdb/solib.c:936: warning: no previous prototype for 'solib_create_inferior_hook'
-../../src/gdb/solib.c:959: warning: no previous prototype for 'in_solib_dynsym_resolve_code'
-../../src/gdb/solib.c:999: warning: no previous prototype for 'no_shared_libraries'
-../../src/gdb/symfile-mem.c:213: warning: no previous prototype for '_initialize_symfile_mem'
-../../src/gdb/linux-tdep.c:28: warning: no previous prototype for 'linux_get_siginfo_type'
-../../src/gdb/inf-ptrace.c:630: warning: no previous prototype for 'inf_ptrace_target'
-../../src/gdb/inf-ptrace.c:766: warning: no previous prototype for 'inf_ptrace_store_registers'
-../../src/gdb/inf-ptrace.c:783: warning: no previous prototype for 'inf_ptrace_trad_target'
-../../src/gdb/fork-child.c:548: warning: no previous prototype for '_initialize_fork_child'
../../src/gdb/i386-nat.c:239: warning: no previous prototype for 'child_post_startup_inferior'
-../../src/gdb/amd64-nat.c:81: warning: no previous prototype for 'amd64_native_gregset_supplies_p'
-../../src/gdb/amd64-nat.c:92: warning: no previous prototype for 'amd64_supply_native_gregset'
-../../src/gdb/amd64-nat.c:123: warning: no previous prototype for 'amd64_collect_native_gregset'
../../src/gdb/amd64-linux-nat.c:340: warning: no previous prototype for 'ps_get_thread_area'
-../../src/gdb/linux-nat.c:4563: warning: no previous prototype for 'linux_nat_terminal_ours'
-../../src/gdb/linux-nat.c:4804: warning: no previous prototype for '_initialize_linux_nat'
../../src/gdb/proc-service.c:117: warning: no previous prototype for 'ps_pstop'
../../src/gdb/proc-service.c:126: warning: no previous prototype for 'ps_pcontinue'
../../src/gdb/proc-service.c:136: warning: no previous prototype for 'ps_lstop'
@@ -36,66 +18,8 @@
../../src/gdb/proc-service.c:295: warning: no previous prototype for 'ps_lgetfpregs'
../../src/gdb/proc-service.c:315: warning: no previous prototype for 'ps_lsetfpregs'
../../src/gdb/proc-service.c:334: warning: no previous prototype for 'ps_getpid'
-../../src/gdb/proc-service.c:340: warning: no previous prototype for '_initialize_proc_service'
-../../src/gdb/linux-thread-db.c:1180: warning: no previous prototype for '_initialize_thread_db'
-../../src/gdb/gcore.c:516: warning: no previous prototype for '_initialize_gcore'
-../../src/gdb/remote.c:5714: warning: no previous prototype for 'remote_send_printf'
-../../src/gdb/cli/cli-logging.c:175: warning: no previous prototype for 'show_logging_command'
-../../src/gdb/cli/cli-logging.c:196: warning: no previous prototype for '_initialize_cli_logging'
-../../src/gdb/tui/tui-command.c:48: warning: no previous prototype for 'tui_dispatch_ctrl_char'
../../src/gdb/tui/tui-data.c:318: warning: no previous prototype for 'set_gen_win_origin'
-../../src/gdb/tui/tui-data.c:489: warning: no previous prototype for 'init_content_element'
-../../src/gdb/tui/tui-data.c:537: warning: no previous prototype for 'init_win_info'
-../../src/gdb/tui/tui-disasm.c:169: warning: no previous prototype for 'tui_set_disassem_content'
-../../src/gdb/tui/tui-disasm.c:272: warning: no previous prototype for 'tui_show_disassem'
-../../src/gdb/tui/tui-disasm.c:295: warning: no previous prototype for 'tui_show_disassem_and_update_source'
-../../src/gdb/tui/tui-disasm.c:324: warning: no previous prototype for 'tui_get_begin_asm_address'
-../../src/gdb/tui/tui-disasm.c:377: warning: no previous prototype for 'tui_vertical_disassem_scroll'
-../../src/gdb/tui/tui-interp.c:195: warning: no previous prototype for '_initialize_tui_interp'
-../../src/gdb/tui/tui-layout.c:136: warning: no previous prototype for 'tui_set_layout'
-../../src/gdb/tui/tui-layout.c:271: warning: no previous prototype for 'tui_add_win_to_layout'
-../../src/gdb/tui/tui-layout.c:322: warning: no previous prototype for 'tui_default_win_height'
-../../src/gdb/tui/tui-layout.c:362: warning: no previous prototype for 'tui_default_win_viewport_height'
-../../src/gdb/tui/tui-layout.c:380: warning: no previous prototype for '_initialize_tui_layout'
-../../src/gdb/tui/tui-regs.c:80: warning: no previous prototype for 'tui_last_regs_line_no'
-../../src/gdb/tui/tui-regs.c:100: warning: no previous prototype for 'tui_line_from_reg_element_no'
-../../src/gdb/tui/tui-regs.c:126: warning: no previous prototype for 'tui_first_reg_element_no_inline'
-../../src/gdb/tui/tui-regs.c:141: warning: no previous prototype for 'tui_last_reg_element_no_in_line'
-../../src/gdb/tui/tui-regs.c:154: warning: no previous prototype for 'tui_show_registers'
-../../src/gdb/tui/tui-regs.c:320: warning: no previous prototype for 'tui_display_registers_from'
-../../src/gdb/tui/tui-regs.c:422: warning: no previous prototype for 'tui_display_reg_element_at_line'
-../../src/gdb/tui/tui-regs.c:457: warning: no previous prototype for 'tui_display_registers_from_line'
-../../src/gdb/tui/tui-regs.c:498: warning: no previous prototype for 'tui_check_register_values'
-../../src/gdb/tui/tui-regs.c:609: warning: no previous prototype for '_initialize_tui_regs'
-../../src/gdb/tui/tui-stack.c:416: warning: no previous prototype for '_initialize_tui_stack'
-../../src/gdb/tui/tui-win.c:275: warning: no previous prototype for 'tui_update_variables'
-../../src/gdb/tui/tui-win.c:341: warning: no previous prototype for 'tui_get_cmd_list'
-../../src/gdb/tui/tui-win.c:353: warning: no previous prototype for '_initialize_tui_win'
-../../src/gdb/tui/tui-win.c:462: warning: no previous prototype for 'tui_update_gdb_sizes'
-../../src/gdb/tui/tui-win.c:478: warning: no previous prototype for 'tui_set_win_focus_to'
-../../src/gdb/tui/tui-win.c:496: warning: no previous prototype for 'tui_scroll_forward'
-../../src/gdb/tui/tui-win.c:521: warning: no previous prototype for 'tui_scroll_backward'
-../../src/gdb/tui/tui-win.c:547: warning: no previous prototype for 'tui_scroll_left'
-../../src/gdb/tui/tui-win.c:569: warning: no previous prototype for 'tui_scroll_right'
-../../src/gdb/tui/tui-win.c:593: warning: no previous prototype for 'tui_scroll'
-../../src/gdb/tui/tui-win.c:616: warning: no previous prototype for 'tui_refresh_all_win'
-../../src/gdb/tui/tui-win.c:651: warning: no previous prototype for 'tui_resize_all'
-../../src/gdb/tui/tui-win.c:812: warning: no previous prototype for 'tui_sigwinch_handler'
-../../src/gdb/tui/tui-win.c:821: warning: no previous prototype for 'tui_initialize_win'
-../../src/gdb/tui/tui-windata.c:48: warning: no previous prototype for 'tui_first_data_item_displayed'
-../../src/gdb/tui/tui-windata.c:73: warning: no previous prototype for 'tui_first_data_element_no_in_line'
-../../src/gdb/tui/tui-windata.c:90: warning: no previous prototype for 'tui_delete_data_content_windows'
-../../src/gdb/tui/tui-windata.c:107: warning: no previous prototype for 'tui_erase_data_content'
-../../src/gdb/tui/tui-windata.c:132: warning: no previous prototype for 'tui_display_all_data'
-../../src/gdb/tui/tui-windata.c:156: warning: no previous prototype for 'tui_display_data_from_line'
-../../src/gdb/tui/tui-windata.c:196: warning: no previous prototype for 'tui_display_data_from'
-../../src/gdb/tui/tui-windata.c:218: warning: no previous prototype for 'tui_refresh_data_win'
-../../src/gdb/tui/tui-windata.c:234: warning: no previous prototype for 'tui_check_data_values'
-../../src/gdb/tui/tui-windata.c:271: warning: no previous prototype for 'tui_vertical_data_scroll'
-../../src/gdb/tui/tui-wingeneral.c:83: warning: no previous prototype for 'box_win'
-../../src/gdb/python/python.c:360: warning: no previous prototype for '_initialize_python'
-cp-name-parser.y:1979: warning: no previous prototype for 'cp_comp_to_string'
-cp-name-parser.y:2016: warning: no previous prototype for 'cp_demangled_name_to_comp'
+../../src/gdb/tui/tui-regs.c:142: warning: no previous prototype for 'tui_last_reg_element_no_in_line'
In file included from ada-exp.y:767:
ada-lex.c:2273: warning: no previous prototype for 'yyget_lineno'
ada-lex.c:2282: warning: no previous prototype for 'yyget_in'
@@ -109,55 +33,10 @@ ada-lex.c:2338: warning: no previous pro
ada-lex.c:2343: warning: no previous prototype for 'yyset_debug'
ada-lex.c:2377: warning: no previous prototype for 'yylex_destroy'
../../src/gdb/ada-lex.l:288: warning: no previous prototype for 'lexer_init'
-ada-exp.y:1525: warning: no previous prototype for '_initialize_ada_exp'
-../../src/gdb/addrmap.c:538: warning: no previous prototype for '_initialize_addrmap'
-../../src/gdb/auxv.c:85: warning: no previous prototype for 'default_auxv_parse'
-../../src/gdb/bfd-target.c:75: warning: no previous prototype for 'target_bfd_xfer_partial'
-../../src/gdb/bfd-target.c:112: warning: no previous prototype for 'target_bfd_xclose'
-../../src/gdb/breakpoint.c:5179: warning: no previous prototype for 'expand_line_sal_maybe'
-../../src/gdb/regcache.c:452: warning: no previous prototype for 'regcache_observer_target_changed'
-../../src/gdb/eval.c:419: warning: no previous prototype for 'value_f90_subarray'
-../../src/gdb/symtab.c:777: warning: no previous prototype for 'find_pc_sect_psymtab_closer'
-../../src/gdb/symfile.c:485: warning: no previous prototype for 'place_section'
-../../src/gdb/infrun.c:1665: warning: no previous prototype for 'infrun_thread_stop_requested'
../../src/gdb/infrun.c:1979: warning: no previous prototype for 'nullify_last_target_wait_ptid'
-../../src/gdb/infrun.c:4853: warning: no previous prototype for 'siginfo_make_value'
-../../src/gdb/exceptions.c:362: warning: no previous prototype for 'print_any_exception'
-../../src/gdb/inf-child.c:163: warning: no previous prototype for 'inf_child_target'
-../../src/gdb/target.c:375: warning: no previous prototype for 'default_get_ada_task_ptid'
-../../src/gdb/target.c:2212: warning: no previous prototype for 'find_default_can_async_p'
-../../src/gdb/target.c:2227: warning: no previous prototype for 'find_default_is_async_p'
-../../src/gdb/target.c:2242: warning: no previous prototype for 'find_default_supports_non_stop'
-../../src/gdb/target.c:2528: warning: no previous prototype for 'dummy_pid_to_str'
-../../src/gdb/findcmd.c:316: warning: no previous prototype for '_initialize_mem_search'
-../../src/gdb/reverse.c:108: warning: no previous prototype for '_initialize_reverse'
../../src/gdb/observer.c:185: warning: no previous prototype for 'observer_test_first_notification_function'
../../src/gdb/observer.c:191: warning: no previous prototype for 'observer_test_second_notification_function'
../../src/gdb/observer.c:197: warning: no previous prototype for 'observer_test_third_notification_function'
-../../src/gdb/stabsread.c:4269: warning: no previous prototype for 'cleanup_undefined_types_noname'
-../../src/gdb/stabsread.c:4304: warning: no previous prototype for 'cleanup_undefined_types_1'
-../../src/gdb/ada-lang.c:1206: warning: no previous prototype for 'ada_la_decode'
-../../src/gdb/ada-lang.c:1219: warning: no previous prototype for 'ada_match_name'
-../../src/gdb/ada-lang.c:1240: warning: no previous prototype for 'ada_suppress_symbol_printing'
-../../src/gdb/ada-lang.c:1575: warning: no previous prototype for 'ada_is_array_type'
-../../src/gdb/ada-lang.c:2321: warning: no previous prototype for 'ada_value_ptr_subscript'
-../../src/gdb/ada-lang.c:2579: warning: no previous prototype for 'ada_array_length'
-../../src/gdb/ada-lang.c:7537: warning: no previous prototype for 'ada_to_static_fixed_value'
-../../src/gdb/ada-lang.c:11072: warning: no previous prototype for '_initialize_ada_language'
-../../src/gdb/ada-tasks.c:159: warning: no previous prototype for 'ada_get_task_number'
-../../src/gdb/ada-tasks.c:204: warning: no previous prototype for 'ada_get_environment_task'
-../../src/gdb/ada-tasks.c:947: warning: no previous prototype for 'ada_task_list_changed'
-../../src/gdb/ada-tasks.c:965: warning: no previous prototype for 'ada_new_objfile_observer'
-../../src/gdb/ada-tasks.c:978: warning: no previous prototype for '_initialize_tasks'
-../../src/gdb/jv-lang.c:1060: warning: no previous prototype for 'java_language_arch_info'
../../src/gdb/ada-typeprint.c:125: warning: no previous prototype for 'ada_typedef_print'
-../../src/gdb/m2-typeprint.c:376: warning: no previous prototype for 'm2_get_discrete_bounds'
-../../src/gdb/cp-valprint.c:508: warning: no previous prototype for 'cp_find_class_member'
-../../src/gdb/utils.c:3546: warning: no previous prototype for '_initialize_utils'
-../../src/gdb/frame.c:1150: warning: no previous prototype for 'frame_observer_target_changed'
-../../src/gdb/gnu-v3-abi.c:488: warning: no previous prototype for 'gnuv3_find_method_in'
-../../src/gdb/target-descriptions.c:1130: warning: no previous prototype for '_initialize_target_descriptions'
-../../src/gdb/inferior.c:235: warning: no previous prototype for 'valid_gdb_inferior_id'
-../../src/gdb/osdata.c:283: warning: no previous prototype for 'info_osdata_command'
The remaining warnings after the patch is installed are:
../../src/gdb/i386-nat.c:239: warning: no previous prototype for 'child_post_startup_inferior'
../../src/gdb/amd64-linux-nat.c:340: warning: no previous prototype for 'ps_get_thread_area'
../../src/gdb/proc-service.c:117: warning: no previous prototype for 'ps_pstop'
../../src/gdb/proc-service.c:126: warning: no previous prototype for 'ps_pcontinue'
../../src/gdb/proc-service.c:136: warning: no previous prototype for 'ps_lstop'
../../src/gdb/proc-service.c:146: warning: no previous prototype for 'ps_lcontinue'
../../src/gdb/proc-service.c:158: warning: no previous prototype for 'ps_lgetxregsize'
../../src/gdb/proc-service.c:168: warning: no previous prototype for 'ps_lgetxregs'
../../src/gdb/proc-service.c:178: warning: no previous prototype for 'ps_lsetxregs'
../../src/gdb/proc-service.c:187: warning: no previous prototype for 'ps_plog'
../../src/gdb/proc-service.c:201: warning: no previous prototype for 'ps_pglobal_lookup'
../../src/gdb/proc-service.c:219: warning: no previous prototype for 'ps_pdread'
../../src/gdb/proc-service.c:228: warning: no previous prototype for 'ps_pdwrite'
../../src/gdb/proc-service.c:238: warning: no previous prototype for 'ps_ptread'
../../src/gdb/proc-service.c:247: warning: no previous prototype for 'ps_ptwrite'
../../src/gdb/proc-service.c:256: warning: no previous prototype for 'ps_lgetregs'
../../src/gdb/proc-service.c:275: warning: no previous prototype for 'ps_lsetregs'
../../src/gdb/proc-service.c:295: warning: no previous prototype for 'ps_lgetfpregs'
../../src/gdb/proc-service.c:315: warning: no previous prototype for 'ps_lsetfpregs'
../../src/gdb/proc-service.c:334: warning: no previous prototype for 'ps_getpid'
../../src/gdb/tui/tui-data.c:318: warning: no previous prototype for 'set_gen_win_origin'
../../src/gdb/tui/tui-regs.c:142: warning: no previous prototype for 'tui_last_reg_element_no_in_line'
In file included from ada-exp.y:767:
ada-lex.c:2273: warning: no previous prototype for 'yyget_lineno'
ada-lex.c:2282: warning: no previous prototype for 'yyget_in'
ada-lex.c:2290: warning: no previous prototype for 'yyget_out'
ada-lex.c:2298: warning: no previous prototype for 'yyget_leng'
ada-lex.c:2307: warning: no previous prototype for 'yyget_text'
ada-lex.c:2316: warning: no previous prototype for 'yyset_lineno'
ada-lex.c:2328: warning: no previous prototype for 'yyset_in'
ada-lex.c:2333: warning: no previous prototype for 'yyset_out'
ada-lex.c:2338: warning: no previous prototype for 'yyget_debug'
ada-lex.c:2343: warning: no previous prototype for 'yyset_debug'
ada-lex.c:2377: warning: no previous prototype for 'yylex_destroy'
../../src/gdb/ada-lex.l:288: warning: no previous prototype for 'lexer_init'
../../src/gdb/infrun.c:1979: warning: no previous prototype for 'nullify_last_target_wait_ptid'
../../src/gdb/observer.c:185: warning: no previous prototype for 'observer_test_first_notification_function'
../../src/gdb/observer.c:191: warning: no previous prototype for 'observer_test_second_notification_function'
../../src/gdb/observer.c:197: warning: no previous prototype for 'observer_test_third_notification_function'
../../src/gdb/ada-typeprint.c:125: warning: no previous prototype for 'ada_typedef_print'
E.g., notice that a few functions here are really unnused and should probably
either be deleted, or there's a bug hiding in there: e.g.,
i386-nat.c:child_post_startup_inferior or ada-typeprint.c:ada_typedef_print.
Apart from other native code that I didn't cover with my small testing, we're
not far off from being able to switch these warnings on.
I've also tried adding "-Wmissing-prototypes", but it shows up a
few more issues than I have energy at the moment to look at.
I'm assuming this the patch only contains obvious content.
--
Pedro Alves
2008-02-18 Pedro Alves <pedro@codesorcery.com>
Silence a few -Wmissing-declarations -Wmissing-prototypes
warnings.
* amd64-nat.c: Include "amd64-nat.h".
* fork-child.c (_initialize_fork_child): Ditto.
* gcore.c (_initialize_gcore): Ditto.
* inf-ptrace.c: Include "inf-ptrace.h".
(inf_ptrace_store_registers): Make it static.
* linux-nat.c (linux_nat_terminal_ours): Make it static.
(_initialize_linux_nat): Declare before definition.
* linux-tdep.c: Include "linux-tdep.h".
* linux-thread-db.c (_initialize_thread_db): Declare before
definition.
* proc-service.c (_initialize_proc_service): Ditto.
* remote.c (remote_send_printf): Make it static.
* solib.c: Include "solib.h".
* symfile-mem.c (_initialize_symfile_mem): Declare before
definition.
* ada-lang.c (ada_la_decode, ada_match_name)
(ada_suppress_symbol_printing, ada_is_array_type)
(ada_value_ptr_subscript, ada_array_length)
(ada_to_static_fixed_value): Make them static.
(_initialize_ada_language): Declare before definition.
* ada-tasks.c (ada_get_task_number, ada_get_environment_task)
(ada_task_list_changed, ada_new_objfile_observer): Make them
static.
(_initialize_tasks): Declare before definition.
* addrmap.c (_initialize_addrmap): Declare before definition.
* auxv.c (default_auxv_parse): Make it static.
* bfd-target.c (target_bfd_xfer_partial, target_bfd_xclose): Make
them static.
* breakpoint.c (remove_sal): Add line break.
(expand_line_sal_maybe): Make it static.
* cp-name-parser.y: Include "cp-support.h".
* cp-valprint.c (cp_find_class_member): Make it static.
* eval.c (value_f90_subarray): Ditto.
* exceptions.c (print_any_exception): Ditto.
* findcmd.c (_initialize_mem_search): Declare before definition.
* frame.c (frame_observer_target_changed): Make it static.
* gnu-v3-abi.c (gnuv3_find_method_in): Make it static.
* inf-child.c: Include "inf-child.h".
* inferior.h (valid_inferior_id): Rename to ...
(valid_gdb_inferior_id): ... this.
* infrun.c (infrun_thread_stop_requested, siginfo_make_value):
Make them static.
* jv-lang.c (java_language_arch_info): Make it static.
* m2-typeprint.c (m2_get_discrete_bounds): Ditto.
* osdata.c (info_osdata_command): Make it static.
* regcache.c (regcache_observer_target_changed): Make it static.
* reverse.c (_initialize_reverse): Declare before definition.
* stabsread.c (cleanup_undefined_types_noname)
(cleanup_undefined_types_1): Make them static.
* symfile.c (place_section): Make it static.
* symtab.c (find_pc_sect_psymtab_closer): Make it static.
* target-descriptions.c (_initialize_target_descriptions): Declare
before definition.
* target.c (default_get_ada_task_ptid, find_default_can_async_p)
(find_default_is_async_p, find_default_supports_non_stop): Make them static.
(target_supports_non_stop): Add prototype.
(dummy_pid_to_str): Make it static.
* utils.c (_initialize_utils): Declare before definition.
* ada-exp.y (_initialize_ada_exp): Declare before definition.
* solib-svr4.c (HAS_LM_DYNAMIC_FROM_LINK_MAP): Add a prototype.
* target.h (struct target_ops): Add a prototype to the
to_can_execute_reverse callback.
* python/python.c (_initialize_python): Declare before definition.
* tui/tui-command.c: Include "tui/tui-command.h".
* tui/tui-data.c (init_content_element, init_win_info): Make them static.
* tui/tui-disasm.c: Include "tui/tui-disasm.h".
* tui/tui-interp.c (_initialize_tui_interp): Declare before
definition.
* tui/tui-layout.c: Include "tui/tui-layout.h".
(_initialize_tui_layout): Declare before definition.
* tui/tui-regs.c: Include "tui/tui-regs.h".
(tui_display_reg_element_at_line): Make it static.
(_initialize_tui_regs): Declare before definition.
* tui/tui-stack.c (_initialize_tui_stack): Declare before
definition.
* tui/tui-win.c: Include "tui/tui-win.h".
(_initialize_tui_win): Declare before definition.
(tui_sigwinch_handler): Make it static. Wrap in ifdef SIGWINCH.
* tui/tui-win.h (tui_sigwinch_handler): Delete declaration.
(tui_get_cmd_list): Add a prototype.
* tui/tui-windata.c: Include tui-windata.h.
* tui/tui-wingeneral.c (box_win): Make it static.
* cli/cli-logging.c (show_logging_command): Make it static.
(_initialize_cli_logging): Declare before definition.
---
gdb/ada-exp.y | 2 ++
gdb/ada-lang.c | 17 ++++++++++-------
gdb/ada-tasks.c | 10 ++++++----
gdb/addrmap.c | 2 ++
gdb/amd64-nat.c | 1 +
gdb/auxv.c | 2 +-
gdb/bfd-target.c | 4 ++--
gdb/breakpoint.c | 5 +++--
gdb/cli/cli-logging.c | 5 ++++-
gdb/cp-name-parser.y | 1 +
gdb/cp-valprint.c | 2 +-
gdb/eval.c | 2 +-
gdb/exceptions.c | 2 +-
gdb/findcmd.c | 2 ++
gdb/fork-child.c | 2 ++
gdb/frame.c | 2 +-
gdb/gcore.c | 2 ++
gdb/gnu-v3-abi.c | 2 +-
gdb/inf-child.c | 1 +
gdb/inf-ptrace.c | 3 ++-
gdb/inferior.h | 2 +-
gdb/infrun.c | 4 ++--
gdb/jv-lang.c | 2 +-
gdb/linux-nat.c | 4 +++-
gdb/linux-tdep.c | 1 +
gdb/linux-thread-db.c | 2 ++
gdb/m2-typeprint.c | 2 +-
gdb/osdata.c | 2 +-
gdb/proc-service.c | 2 ++
gdb/python/python.c | 2 ++
gdb/regcache.c | 2 +-
gdb/remote.c | 2 +-
gdb/reverse.c | 2 ++
gdb/solib-svr4.c | 2 +-
gdb/solib.c | 1 +
gdb/stabsread.c | 4 ++--
gdb/symfile-mem.c | 4 ++++
gdb/symfile.c | 2 +-
gdb/symtab.c | 2 +-
gdb/target-descriptions.c | 3 +++
gdb/target.c | 12 ++++++------
gdb/target.h | 2 +-
gdb/tui/tui-command.c | 1 +
gdb/tui/tui-data.c | 4 ++--
gdb/tui/tui-disasm.c | 1 +
gdb/tui/tui-interp.c | 3 +++
gdb/tui/tui-layout.c | 4 ++++
gdb/tui/tui-regs.c | 5 ++++-
gdb/tui/tui-stack.c | 3 +++
gdb/tui/tui-win.c | 9 +++++++--
gdb/tui/tui-win.h | 3 +--
gdb/tui/tui-windata.c | 1 +
gdb/tui/tui-wingeneral.c | 2 +-
gdb/utils.c | 2 ++
54 files changed, 116 insertions(+), 52 deletions(-)
Index: src/gdb/amd64-nat.c
===================================================================
--- src.orig/gdb/amd64-nat.c 2009-02-17 23:52:06.000000000 +0000
+++ src/gdb/amd64-nat.c 2009-02-18 00:01:50.000000000 +0000
@@ -26,6 +26,7 @@
#include "i386-tdep.h"
#include "amd64-tdep.h"
+#include "amd64-nat.h"
/* The following bits of code help with implementing debugging 32-bit
code natively on AMD64. The idea is to define two mappings between
Index: src/gdb/cli/cli-logging.c
===================================================================
--- src.orig/gdb/cli/cli-logging.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/cli/cli-logging.c 2009-02-18 00:01:50.000000000 +0000
@@ -170,7 +170,7 @@ Usage: set logging on [FILENAME]\n\
set logging redirect [on|off]\n"));
}
-void
+static void
show_logging_command (char *args, int from_tty)
{
if (saved_filename)
@@ -191,6 +191,9 @@ show_logging_command (char *args, int fr
printf_unfiltered (_("Output will be logged and displayed.\n"));
}
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_cli_logging;
+
void
_initialize_cli_logging (void)
{
Index: src/gdb/fork-child.c
===================================================================
--- src.orig/gdb/fork-child.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/fork-child.c 2009-02-18 00:01:50.000000000 +0000
@@ -543,6 +543,8 @@ unset_exec_wrapper_command (char *args,
exec_wrapper = NULL;
}
+extern initialize_file_ftype _initialize_fork_child; /* -Wmissing-prototypes */
+
void
_initialize_fork_child (void)
{
Index: src/gdb/gcore.c
===================================================================
--- src.orig/gdb/gcore.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/gcore.c 2009-02-18 00:01:50.000000000 +0000
@@ -511,6 +511,8 @@ gcore_memory_sections (bfd *obfd)
return 1;
}
+extern initialize_file_ftype _initialize_gcore; /* -Wmissing-prototypes */
+
void
_initialize_gcore (void)
{
Index: src/gdb/inf-ptrace.c
===================================================================
--- src.orig/gdb/inf-ptrace.c 2009-02-17 23:52:06.000000000 +0000
+++ src/gdb/inf-ptrace.c 2009-02-18 00:01:50.000000000 +0000
@@ -32,6 +32,7 @@
#include "gdb_wait.h"
#include <signal.h>
+#include "inf-ptrace.h"
#include "inf-child.h"
#include "gdbthread.h"
@@ -761,7 +762,7 @@ inf_ptrace_store_register (const struct
/* Store register REGNUM back into the inferior. If REGNUM is -1, do
this for all registers. */
-void
+static void
inf_ptrace_store_registers (struct regcache *regcache, int regnum)
{
if (regnum == -1)
Index: src/gdb/linux-nat.c
===================================================================
--- src.orig/gdb/linux-nat.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/linux-nat.c 2009-02-18 00:01:50.000000000 +0000
@@ -4558,7 +4558,7 @@ linux_nat_terminal_inferior (void)
/* target_terminal_ours implementation. */
-void
+static void
linux_nat_terminal_ours (void)
{
if (!target_is_async_p ())
@@ -4799,6 +4799,8 @@ linux_nat_setup_async (void)
fcntl (linux_nat_event_pipe[1], F_SETFL, O_NONBLOCK);
}
+extern initialize_file_ftype _initialize_linux_nat; /* -Wmissing-prototypes */
+
void
_initialize_linux_nat (void)
{
Index: src/gdb/linux-tdep.c
===================================================================
--- src.orig/gdb/linux-tdep.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/linux-tdep.c 2009-02-18 00:01:50.000000000 +0000
@@ -19,6 +19,7 @@
#include "defs.h"
#include "gdbtypes.h"
+#include "linux-tdep.h"
/* This function is suitable for architectures that don't
extend/override the standard siginfo structure. */
Index: src/gdb/linux-thread-db.c
===================================================================
--- src.orig/gdb/linux-thread-db.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/linux-thread-db.c 2009-02-18 00:01:50.000000000 +0000
@@ -1175,6 +1175,8 @@ init_thread_db_ops (void)
thread_db_ops.to_magic = OPS_MAGIC;
}
+extern initialize_file_ftype _initialize_thread_db; /* -Wmissing-prototypes */
+
void
_initialize_thread_db (void)
{
Index: src/gdb/proc-service.c
===================================================================
--- src.orig/gdb/proc-service.c 2009-02-17 23:52:06.000000000 +0000
+++ src/gdb/proc-service.c 2009-02-18 00:01:50.000000000 +0000
@@ -335,6 +335,8 @@ ps_getpid (gdb_ps_prochandle_t ph)
return ph->pid;
}
+extern initialize_file_ftype _initialize_proc_service; /* -Wmissing-prototypes */
+
void
_initialize_proc_service (void)
{
Index: src/gdb/remote.c
===================================================================
--- src.orig/gdb/remote.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/remote.c 2009-02-18 00:01:50.000000000 +0000
@@ -5709,7 +5709,7 @@ remote_xfer_memory (CORE_ADDR mem_addr,
FORMAT and the remaining arguments, then gets the reply. Returns
whether the packet was a success, a failure, or unknown. */
-enum packet_result
+static enum packet_result
remote_send_printf (const char *format, ...)
{
struct remote_state *rs = get_remote_state ();
Index: src/gdb/solib.c
===================================================================
--- src.orig/gdb/solib.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/solib.c 2009-02-18 00:01:50.000000000 +0000
@@ -45,6 +45,7 @@
#include "observer.h"
#include "readline/readline.h"
#include "remote.h"
+#include "solib.h"
/* Architecture-specific operations. */
Index: src/gdb/symfile-mem.c
===================================================================
--- src.orig/gdb/symfile-mem.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/symfile-mem.c 2009-02-18 00:01:50.000000000 +0000
@@ -208,6 +208,10 @@ try using the \"file\" command first."))
}
+
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_symfile_mem;
+
void
_initialize_symfile_mem (void)
{
Index: src/gdb/ada-lang.c
===================================================================
--- src.orig/gdb/ada-lang.c 2009-02-17 23:52:06.000000000 +0000
+++ src/gdb/ada-lang.c 2009-02-18 00:01:50.000000000 +0000
@@ -1201,7 +1201,7 @@ ada_decode_symbol (const struct general_
return *resultp;
}
-char *
+static char *
ada_la_decode (const char *encoded, int options)
{
return xstrdup (ada_decode (encoded));
@@ -1214,7 +1214,7 @@ ada_la_decode (const char *encoded, int
suffix of SYM_NAME minus the same suffixes. Also returns 0 if
either argument is NULL. */
-int
+static int
ada_match_name (const char *sym_name, const char *name, int wild)
{
if (sym_name == NULL || name == NULL)
@@ -1235,7 +1235,7 @@ ada_match_name (const char *sym_name, co
/* True (non-zero) iff, in Ada mode, the symbol SYM should be
suppressed in info listings. */
-int
+static int
ada_suppress_symbol_printing (struct symbol *sym)
{
if (SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN)
@@ -1570,7 +1570,7 @@ ada_is_direct_array_type (struct type *t
/* Non-zero iff TYPE represents any kind of array in Ada, or a pointer
* to one. */
-int
+static int
ada_is_array_type (struct type *type)
{
while (type != NULL
@@ -2315,7 +2315,7 @@ ada_value_subscript (struct value *arr,
value of the element of *ARR at the ARITY indices given in
IND. Does not read the entire array into memory. */
-struct value *
+static struct value *
ada_value_ptr_subscript (struct value *arr, struct type *type, int arity,
struct value **ind)
{
@@ -2574,7 +2574,7 @@ ada_array_bound (struct value *arr, int
Does not work for arrays indexed by enumeration types with representation
clauses at the moment. */
-struct value *
+static struct value *
ada_array_length (struct value *arr, int n)
{
struct type *arr_type = ada_check_typedef (value_type (arr));
@@ -7532,7 +7532,7 @@ ada_to_fixed_value (struct value *val)
without consulting any runtime values. For Ada dynamic-sized
types, therefore, the type of the result is likely to be inaccurate. */
-struct value *
+static struct value *
ada_to_static_fixed_value (struct value *val)
{
struct type *type =
@@ -11067,6 +11067,9 @@ const struct language_defn ada_language_
LANG_MAGIC
};
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_ada_language;
+
void
_initialize_ada_language (void)
{
Index: src/gdb/ada-tasks.c
===================================================================
--- src.orig/gdb/ada-tasks.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/ada-tasks.c 2009-02-18 00:01:50.000000000 +0000
@@ -154,7 +154,7 @@ static int stale_task_list_p = 1;
/* Return the task number of the task whose ptid is PTID, or zero
if the task could not be found. */
-int
+static int
ada_get_task_number (ptid_t ptid)
{
int i;
@@ -199,7 +199,7 @@ valid_task_id (int task_num)
/* Return the task info associated to the Environment Task.
This function assumes that the inferior does in fact use tasking. */
-struct ada_task_info *
+static struct ada_task_info *
ada_get_environment_task (void)
{
ada_build_task_list (0);
@@ -942,7 +942,7 @@ Task switching not supported when debugg
/* Indicate that the task list may have changed, so invalidate the cache. */
-void
+static void
ada_task_list_changed (void)
{
stale_task_list_p = 1;
@@ -960,7 +960,7 @@ ada_normal_stop_observer (struct bpstats
/* A routine to be called when the objfiles have changed. */
-void
+static void
ada_new_objfile_observer (struct objfile *objfile)
{
/* Invalidate all cached data that were extracted from an objfile. */
@@ -973,6 +973,8 @@ ada_new_objfile_observer (struct objfile
ada_tasks_check_symbol_table = 1;
}
+extern initialize_file_ftype _initialize_tasks; /* -Wmissing-prototypes */
+
void
_initialize_tasks (void)
{
Index: src/gdb/addrmap.c
===================================================================
--- src.orig/gdb/addrmap.c 2009-02-17 23:52:06.000000000 +0000
+++ src/gdb/addrmap.c 2009-02-18 00:01:50.000000000 +0000
@@ -533,6 +533,8 @@ addrmap_create_mutable (struct obstack *
/* Initialization. */
+extern initialize_file_ftype _initialize_addrmap; /* -Wmissing-prototypes */
+
void
_initialize_addrmap (void)
{
Index: src/gdb/auxv.c
===================================================================
--- src.orig/gdb/auxv.c 2009-02-17 23:52:06.000000000 +0000
+++ src/gdb/auxv.c 2009-02-18 00:01:50.000000000 +0000
@@ -79,7 +79,7 @@ procfs_xfer_auxv (struct target_ops *ops
Return 0 if *READPTR is already at the end of the buffer.
Return -1 if there is insufficient buffer for a whole entry.
Return 1 if an entry was read into *TYPEP and *VALP. */
-int
+static int
default_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
{
Index: src/gdb/bfd-target.c
===================================================================
--- src.orig/gdb/bfd-target.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/bfd-target.c 2009-02-18 00:01:50.000000000 +0000
@@ -66,7 +66,7 @@ build_target_sections_from_bfd (struct t
gdb_assert (cl.end - start <= count);
}
-LONGEST
+static LONGEST
target_bfd_xfer_partial (struct target_ops *ops,
enum target_object object,
const char *annex, gdb_byte *readbuf,
@@ -107,7 +107,7 @@ target_bfd_xfer_partial (struct target_o
}
}
-void
+static void
target_bfd_xclose (struct target_ops *t, int quitting)
{
bfd_close (t->to_data);
Index: src/gdb/breakpoint.c
===================================================================
--- src.orig/gdb/breakpoint.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/breakpoint.c 2009-02-18 00:01:50.000000000 +0000
@@ -5149,7 +5149,8 @@ create_breakpoint (struct symtabs_and_li
/* Remove element at INDEX_TO_REMOVE from SAL, shifting other
elements to fill the void space. */
-static void remove_sal (struct symtabs_and_lines *sal, int index_to_remove)
+static void
+remove_sal (struct symtabs_and_lines *sal, int index_to_remove)
{
int i = index_to_remove+1;
int last_index = sal->nelts-1;
@@ -5174,7 +5175,7 @@ static void remove_sal (struct symtabs_a
line in all existing instantiations of 'foo'.
*/
-struct symtabs_and_lines
+static struct symtabs_and_lines
expand_line_sal_maybe (struct symtab_and_line sal)
{
struct symtabs_and_lines expanded;
Index: src/gdb/cp-name-parser.y
===================================================================
--- src.orig/gdb/cp-name-parser.y 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/cp-name-parser.y 2009-02-18 00:01:50.000000000 +0000
@@ -42,6 +42,7 @@ Boston, MA 02110-1301, USA. */
#include "safe-ctype.h"
#include "libiberty.h"
#include "demangle.h"
+#include "cp-support.h"
/* Bison does not make it easy to create a parser without global
state, unfortunately. Here are all the global variables used
Index: src/gdb/cp-valprint.c
===================================================================
--- src.orig/gdb/cp-valprint.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/cp-valprint.c 2009-02-18 00:01:50.000000000 +0000
@@ -502,7 +502,7 @@ cp_print_static_field (struct type *type
field number. If OFFSET is not exactly at the start of some field, set
*DOMAIN to NULL. */
-void
+static void
cp_find_class_member (struct type **domain_p, int *fieldno,
LONGEST offset)
{
Index: src/gdb/eval.c
===================================================================
--- src.orig/gdb/eval.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/eval.c 2009-02-18 00:01:50.000000000 +0000
@@ -413,7 +413,7 @@ init_array_element (struct value *array,
return index;
}
-struct value *
+static struct value *
value_f90_subarray (struct value *array,
struct expression *exp, int *pos, enum noside noside)
{
Index: src/gdb/exceptions.c
===================================================================
--- src.orig/gdb/exceptions.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/exceptions.c 2009-02-18 00:01:50.000000000 +0000
@@ -356,7 +356,7 @@ exception_fprintf (struct ui_file *file,
}
}
-void
+static void
print_any_exception (struct ui_file *file, const char *prefix,
struct gdb_exception e)
{
Index: src/gdb/findcmd.c
===================================================================
--- src.orig/gdb/findcmd.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/findcmd.c 2009-02-18 00:01:50.000000000 +0000
@@ -311,6 +311,8 @@ find_command (char *args, int from_tty)
do_cleanups (old_cleanups);
}
+extern initialize_file_ftype _initialize_mem_search; /* -Wmissing-prototypes */
+
void
_initialize_mem_search (void)
{
Index: src/gdb/frame.c
===================================================================
--- src.orig/gdb/frame.c 2009-02-17 23:52:06.000000000 +0000
+++ src/gdb/frame.c 2009-02-18 00:01:50.000000000 +0000
@@ -1145,7 +1145,7 @@ get_next_frame (struct frame_info *this_
/* Observer for the target_changed event. */
-void
+static void
frame_observer_target_changed (struct target_ops *target)
{
reinit_frame_cache ();
Index: src/gdb/gnu-v3-abi.c
===================================================================
--- src.orig/gdb/gnu-v3-abi.c 2009-02-17 23:52:06.000000000 +0000
+++ src/gdb/gnu-v3-abi.c 2009-02-18 00:01:50.000000000 +0000
@@ -482,7 +482,7 @@ gnuv3_baseclass_offset (struct type *typ
which has virtual table index VOFFSET. The method has an associated
"this" adjustment of ADJUSTMENT bytes. */
-const char *
+static const char *
gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset,
LONGEST adjustment)
{
Index: src/gdb/inf-child.c
===================================================================
--- src.orig/gdb/inf-child.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/inf-child.c 2009-02-18 00:01:50.000000000 +0000
@@ -27,6 +27,7 @@
#include "target.h"
#include "inferior.h"
#include "gdb_string.h"
+#include "inf-child.h"
/* Fetch register REGNUM from the inferior. If REGNUM is -1, do this
for all registers. */
Index: src/gdb/inferior.h
===================================================================
--- src.orig/gdb/inferior.h 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/inferior.h 2009-02-18 00:01:50.000000000 +0000
@@ -479,7 +479,7 @@ extern int in_inferior_list (int pid);
/* Boolean test for an already-known inferior id (GDB's homegrown id,
not the system's). */
-extern int valid_inferior_id (int num);
+extern int valid_gdb_inferior_id (int num);
/* Search function to lookup a inferior by target 'pid'. */
extern struct inferior *find_inferior_pid (int pid);
Index: src/gdb/infrun.c
===================================================================
--- src.orig/gdb/infrun.c 2009-02-17 23:52:06.000000000 +0000
+++ src/gdb/infrun.c 2009-02-18 00:01:50.000000000 +0000
@@ -1660,7 +1660,7 @@ infrun_thread_stop_requested_callback (s
Cleanup local state that assumed the PTID was to be resumed, and
report the stop to the frontend. */
-void
+static void
infrun_thread_stop_requested (ptid_t ptid)
{
struct displaced_step_request *it, *next, *prev = NULL;
@@ -4848,7 +4848,7 @@ static struct lval_funcs siginfo_value_f
the current thread. Return a void value if there's no object
available. */
-struct value *
+static struct value *
siginfo_make_value (struct internalvar *var)
{
struct type *type;
Index: src/gdb/jv-lang.c
===================================================================
--- src.orig/gdb/jv-lang.c 2009-02-17 23:52:06.000000000 +0000
+++ src/gdb/jv-lang.c 2009-02-18 00:01:50.000000000 +0000
@@ -1054,7 +1054,7 @@ enum java_primitive_types
nr_java_primitive_types
};
-void
+static void
java_language_arch_info (struct gdbarch *gdbarch,
struct language_arch_info *lai)
{
Index: src/gdb/m2-typeprint.c
===================================================================
--- src.orig/gdb/m2-typeprint.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/m2-typeprint.c 2009-02-18 00:01:50.000000000 +0000
@@ -371,7 +371,7 @@ m2_is_long_set (struct type *type)
This should be integrated into gdbtypes.c
inside get_discrete_bounds. */
-int
+static int
m2_get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
{
CHECK_TYPEDEF (type);
Index: src/gdb/osdata.c
===================================================================
--- src.orig/gdb/osdata.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/osdata.c 2009-02-18 00:01:50.000000000 +0000
@@ -278,7 +278,7 @@ get_osdata_column (struct osdata_item *i
return NULL;
}
-void
+static void
info_osdata_command (char *type, int from_tty)
{
struct osdata *osdata = NULL;
Index: src/gdb/python/python.c
===================================================================
--- src.orig/gdb/python/python.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/python/python.c 2009-02-18 00:01:50.000000000 +0000
@@ -355,6 +355,8 @@ show_python (char *args, int from_tty)
/* Initialize the Python code. */
+extern initialize_file_ftype _initialize_python; /* -Wmissing-prototypes */
+
void
_initialize_python (void)
{
Index: src/gdb/regcache.c
===================================================================
--- src.orig/gdb/regcache.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/regcache.c 2009-02-18 00:01:50.000000000 +0000
@@ -447,7 +447,7 @@ struct regcache *get_current_regcache (v
/* Observer for the target_changed event. */
-void
+static void
regcache_observer_target_changed (struct target_ops *target)
{
registers_changed ();
Index: src/gdb/reverse.c
===================================================================
--- src.orig/gdb/reverse.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/reverse.c 2009-02-18 00:01:50.000000000 +0000
@@ -103,6 +103,8 @@ reverse_finish (char *args, int from_tty
exec_reverse_once ("finish", args, from_tty);
}
+extern initialize_file_ftype _initialize_reverse; /* -Wmissing-prototypes */
+
void
_initialize_reverse (void)
{
Index: src/gdb/stabsread.c
===================================================================
--- src.orig/gdb/stabsread.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/stabsread.c 2009-02-18 00:01:50.000000000 +0000
@@ -4264,7 +4264,7 @@ add_undefined_type (struct type *type, i
/* Try to fix all undefined types pushed on the UNDEF_TYPES vector. */
-void
+static void
cleanup_undefined_types_noname (void)
{
int i;
@@ -4299,7 +4299,7 @@ cleanup_undefined_types_noname (void)
yet defined at the time a pointer to it was made.
Fix: Do a full lookup on the struct/union tag. */
-void
+static void
cleanup_undefined_types_1 (void)
{
struct type **type;
Index: src/gdb/symfile.c
===================================================================
--- src.orig/gdb/symfile.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/symfile.c 2009-02-18 00:01:50.000000000 +0000
@@ -480,7 +480,7 @@ struct place_section_arg
/* Find a unique offset to use for loadable section SECT if
the user did not provide an offset. */
-void
+static void
place_section (bfd *abfd, asection *sect, void *obj)
{
struct place_section_arg *arg = obj;
Index: src/gdb/symtab.c
===================================================================
--- src.orig/gdb/symtab.c 2009-02-17 23:52:06.000000000 +0000
+++ src/gdb/symtab.c 2009-02-18 00:01:50.000000000 +0000
@@ -770,7 +770,7 @@ matching_obj_sections (struct obj_sectio
/* Find which partial symtab contains PC and SECTION starting at psymtab PST.
We may find a different psymtab than PST. See FIND_PC_SECT_PSYMTAB. */
-struct partial_symtab *
+static struct partial_symtab *
find_pc_sect_psymtab_closer (CORE_ADDR pc, struct obj_section *section,
struct partial_symtab *pst,
struct minimal_symbol *msymbol)
Index: src/gdb/target-descriptions.c
===================================================================
--- src.orig/gdb/target-descriptions.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/target-descriptions.c 2009-02-18 00:01:50.000000000 +0000
@@ -1125,6 +1125,9 @@ maint_print_c_tdesc_cmd (char *args, int
printf_unfiltered ("}\n");
}
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_target_descriptions;
+
void
_initialize_target_descriptions (void)
{
Index: src/gdb/target.c
===================================================================
--- src.orig/gdb/target.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/target.c 2009-02-18 00:01:50.000000000 +0000
@@ -370,7 +370,7 @@ kill_or_be_killed (int from_tty)
the PTID lwp and tid elements. The pid used is the pid of the
inferior_ptid. */
-ptid_t
+static ptid_t
default_get_ada_task_ptid (long lwp, long tid)
{
return ptid_build (ptid_get_pid (inferior_ptid), lwp, tid);
@@ -2207,7 +2207,7 @@ find_default_create_inferior (struct tar
return;
}
-int
+static int
find_default_can_async_p (void)
{
struct target_ops *t;
@@ -2222,7 +2222,7 @@ find_default_can_async_p (void)
return 0;
}
-int
+static int
find_default_is_async_p (void)
{
struct target_ops *t;
@@ -2237,7 +2237,7 @@ find_default_is_async_p (void)
return 0;
}
-int
+static int
find_default_supports_non_stop (void)
{
struct target_ops *t;
@@ -2249,7 +2249,7 @@ find_default_supports_non_stop (void)
}
int
-target_supports_non_stop ()
+target_supports_non_stop (void)
{
struct target_ops *t;
for (t = ¤t_target; t != NULL; t = t->beneath)
@@ -2523,7 +2523,7 @@ normal_pid_to_str (ptid_t ptid)
return buf;
}
-char *
+static char *
dummy_pid_to_str (struct target_ops *ops, ptid_t ptid)
{
return normal_pid_to_str (ptid);
Index: src/gdb/tui/tui-command.c
===================================================================
--- src.orig/gdb/tui/tui-command.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/tui/tui-command.c 2009-02-18 00:01:50.000000000 +0000
@@ -26,6 +26,7 @@
#include "tui/tui-data.h"
#include "tui/tui-win.h"
#include "tui/tui-io.h"
+#include "tui/tui-command.h"
#include "gdb_curses.h"
#include "gdb_string.h"
Index: src/gdb/tui/tui-data.c
===================================================================
--- src.orig/gdb/tui/tui-data.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/tui/tui-data.c 2009-02-18 00:01:50.000000000 +0000
@@ -483,7 +483,7 @@ tui_init_generic_part (struct tui_gen_wi
/* init_content_element().
*/
-void
+static void
init_content_element (struct tui_win_element *element,
enum tui_win_type type)
{
@@ -532,7 +532,7 @@ init_content_element (struct tui_win_ele
}
}
-void
+static void
init_win_info (struct tui_win_info *win_info)
{
tui_init_generic_part (&win_info->generic);
Index: src/gdb/tui/tui-disasm.c
===================================================================
--- src.orig/gdb/tui/tui-disasm.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/tui/tui-disasm.c 2009-02-18 00:01:50.000000000 +0000
@@ -35,6 +35,7 @@
#include "tui/tui-winsource.h"
#include "tui/tui-stack.h"
#include "tui/tui-file.h"
+#include "tui/tui-disasm.h"
#include "gdb_curses.h"
Index: src/gdb/tui/tui-interp.c
===================================================================
--- src.orig/gdb/tui/tui-interp.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/tui/tui-interp.c 2009-02-18 00:01:50.000000000 +0000
@@ -190,6 +190,9 @@ tui_command_loop (void *data)
return;
}
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_tui_interp;
+
void
_initialize_tui_interp (void)
{
Index: src/gdb/tui/tui-layout.c
===================================================================
--- src.orig/gdb/tui/tui-layout.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/tui/tui-layout.c 2009-02-18 00:01:50.000000000 +0000
@@ -36,6 +36,7 @@
#include "tui/tui-win.h"
#include "tui/tui-winsource.h"
#include "tui/tui-disasm.h"
+#include "tui/tui-layout.h"
#include "gdb_string.h"
#include "gdb_curses.h"
@@ -375,6 +376,9 @@ tui_default_win_viewport_height (enum tu
/* Function to initialize gdb commands, for tui window layout
manipulation. */
+
+extern initialize_file_ftype _initialize_tui_layout; /* -Wmissing-prototypes */
+
void
_initialize_tui_layout (void)
{
Index: src/gdb/tui/tui-regs.c
===================================================================
--- src.orig/gdb/tui/tui-regs.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/tui/tui-regs.c 2009-02-18 00:01:50.000000000 +0000
@@ -36,6 +36,7 @@
#include "tui/tui-windata.h"
#include "tui/tui-wingeneral.h"
#include "tui/tui-file.h"
+#include "tui/tui-regs.h"
#include "reggroups.h"
#include "valprint.h"
@@ -416,7 +417,7 @@ tui_display_registers_from (int start_el
'start_element_no' on 'start_line_no' until the end of the register
content or the end of the display height. This function checks
that we won't display off the end of the register display. */
-void
+static void
tui_display_reg_element_at_line (int start_element_no,
int start_line_no)
{
@@ -604,6 +605,8 @@ tui_reg_command (char *args, int from_tt
help_list (tuireglist, "tui reg ", -1, gdb_stdout);
}
+extern initialize_file_ftype _initialize_tui_regs; /* -Wmissing-prototypes */
+
void
_initialize_tui_regs (void)
{
Index: src/gdb/tui/tui-stack.c
===================================================================
--- src.orig/gdb/tui/tui-stack.c 2009-02-17 23:52:06.000000000 +0000
+++ src/gdb/tui/tui-stack.c 2009-02-18 00:01:50.000000000 +0000
@@ -411,6 +411,9 @@ tui_show_frame_info (struct frame_info *
/* Function to initialize gdb commands, for tui window stack
manipulation. */
+
+extern initialize_file_ftype _initialize_tui_stack; /* -Wmissing-prototypes */
+
void
_initialize_tui_stack (void)
{
Index: src/gdb/tui/tui-win.c
===================================================================
--- src.orig/gdb/tui/tui-win.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/tui/tui-win.c 2009-02-18 00:01:50.000000000 +0000
@@ -43,6 +43,7 @@
#include "tui/tui-source.h"
#include "tui/tui-winsource.h"
#include "tui/tui-windata.h"
+#include "tui/tui-win.h"
#include "gdb_curses.h"
@@ -348,6 +349,9 @@ tui_get_cmd_list (void)
/* Function to initialize gdb commands, for tui window
manipulation. */
+
+extern initialize_file_ftype _initialize_tui_win; /* -Wmissing-prototypes */
+
void
_initialize_tui_win (void)
{
@@ -803,17 +807,18 @@ tui_resize_all (void)
}
}
-
+#ifdef SIGWINCH
/* SIGWINCH signal handler for the tui. This signal handler is always
called, even when the readline package clears signals because it is
set as the old_sigwinch() (TUI only). */
-void
+static void
tui_sigwinch_handler (int signal)
{
/* Say that a resize was done so that the readline can do it later
when appropriate. */
tui_set_win_resized_to (TRUE);
}
+#endif
/* Initializes SIGWINCH signal handler for the tui. */
void
Index: src/gdb/tui/tui-win.h
===================================================================
--- src.orig/gdb/tui/tui-win.h 2009-02-17 23:52:06.000000000 +0000
+++ src/gdb/tui/tui-win.h 2009-02-18 00:01:50.000000000 +0000
@@ -36,7 +36,6 @@ extern void tui_scroll (enum tui_scroll_
extern void tui_set_win_focus_to (struct tui_win_info *);
extern void tui_resize_all (void);
extern void tui_refresh_all_win (void);
-extern void tui_sigwinch_handler (int);
extern chtype tui_border_ulcorner;
extern chtype tui_border_urcorner;
@@ -55,6 +54,6 @@ extern void tui_initialize_win (void);
extern void tui_update_gdb_sizes (void);
/* Create or get the TUI command list. */
-struct cmd_list_element **tui_get_cmd_list ();
+struct cmd_list_element **tui_get_cmd_list (void);
#endif
Index: src/gdb/tui/tui-windata.c
===================================================================
--- src.orig/gdb/tui/tui-windata.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/tui/tui-windata.c 2009-02-18 00:01:50.000000000 +0000
@@ -25,6 +25,7 @@
#include "tui/tui-data.h"
#include "tui/tui-wingeneral.h"
#include "tui/tui-regs.h"
+#include "tui/tui-windata.h"
#include "gdb_string.h"
#include "gdb_curses.h"
Index: src/gdb/tui/tui-wingeneral.c
===================================================================
--- src.orig/gdb/tui/tui-wingeneral.c 2009-02-17 23:52:06.000000000 +0000
+++ src/gdb/tui/tui-wingeneral.c 2009-02-18 00:01:50.000000000 +0000
@@ -77,7 +77,7 @@ tui_delete_win (WINDOW *window)
/* Draw a border arround the window. */
-void
+static void
box_win (struct tui_gen_win_info *win_info,
int highlight_flag)
{
Index: src/gdb/utils.c
===================================================================
--- src.orig/gdb/utils.c 2009-02-17 23:52:05.000000000 +0000
+++ src/gdb/utils.c 2009-02-18 00:01:50.000000000 +0000
@@ -3541,6 +3541,8 @@ gdb_buildargv (const char *s)
return argv;
}
+extern initialize_file_ftype _initialize_utils; /* -Wmissing-prototypes */
+
void
_initialize_utils (void)
{
Index: src/gdb/ada-exp.y
===================================================================
--- src.orig/gdb/ada-exp.y 2009-02-17 23:52:06.000000000 +0000
+++ src/gdb/ada-exp.y 2009-02-18 00:01:50.000000000 +0000
@@ -1520,6 +1520,8 @@ type_system_address (void)
return type != NULL ? type : parse_type->builtin_data_ptr;
}
+extern initialize_file_ftype _initialize_ada_exp; /* -Wmissing-prototypes */
+
void
_initialize_ada_exp (void)
{
Index: src/gdb/solib-svr4.c
===================================================================
--- src.orig/gdb/solib-svr4.c 2009-02-18 00:04:12.000000000 +0000
+++ src/gdb/solib-svr4.c 2009-02-18 00:04:26.000000000 +0000
@@ -149,7 +149,7 @@ LM_ADDR_FROM_LINK_MAP (struct so_list *s
}
static int
-HAS_LM_DYNAMIC_FROM_LINK_MAP ()
+HAS_LM_DYNAMIC_FROM_LINK_MAP (void)
{
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
Index: src/gdb/target.h
===================================================================
--- src.orig/gdb/target.h 2009-02-18 00:03:40.000000000 +0000
+++ src/gdb/target.h 2009-02-18 00:03:57.000000000 +0000
@@ -538,7 +538,7 @@ struct target_ops
CORE_ADDR *found_addrp);
/* Can target execute in reverse? */
- int (*to_can_execute_reverse) ();
+ int (*to_can_execute_reverse) (void);
/* Does this target support debugging multiple processes
simultaneously? */