From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27895 invoked by alias); 14 Mar 2011 14:21:07 -0000 Received: (qmail 27882 invoked by uid 22791); 14 Mar 2011 14:21:06 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT,TW_BJ,TW_EG X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.155) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Mar 2011 14:20:57 +0000 Received: from md2.u-strasbg.fr (md2.u-strasbg.fr [IPv6:2001:660:2402::187]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id p2EEKmKC034615 ; Mon, 14 Mar 2011 15:20:48 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms3.u-strasbg.fr [130.79.204.12]) by md2.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p2EEKlLw083828 ; Mon, 14 Mar 2011 15:20:48 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from E6510Muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p2EEKk6l099349 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) ; Mon, 14 Mar 2011 15:20:46 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Eli Zaretskii'" , "'Pedro Alves'" Cc: References: <20110312015329.GA20179@sourceware.org> <201103141213.43979.pedro@codesourcery.com> <201103141251.31400.pedro@codesourcery.com> In-Reply-To: Subject: RE: New ARI warning Sat Mar 12 01:53:29 UTC 2011 Date: Mon, 14 Mar 2011 15:46:00 -0000 Message-ID: <001b01cbe253$048d6790$0da836b0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-03/txt/msg00729.txt.bz2 > > I'm fine with your suggestion, and in fact it's my preference > > as well. However, there _are_ cases where you just can't do that, > > because the return type + function name + parameter end up being > > too long for a single line. > > What's wrong with leaving a single long line in such cases? They are > supposed to be very rare (if typedefs are used for complex function > arguments). Take for instance a look at hppa-tdep.h: my patch changes <<>>> extern struct hppa_objfile_private * hppa_init_objfile_priv_data (struct objfile *objfile); <<>>> into: <<>>> extern struct hppa_objfile_private * hppa_init_objfile_priv_data (struct objfile *objfile); <<>>> Your suggestion would lead to: <<>>> extern struct hppa_objfile_private * hppa_init_objfile_priv_data (struct objfile *objfile); <<>>> on a single line (might have been corrupted by my mailer...) 91 column wide... but if you look at the rest of the hppa-tdep.h file, you will find: <<>>> extern struct value * hppa_frame_prev_register_helper (struct frame_info *this_frame, struct trad_frame_saved_reg *saved_regs, int regnum); extern CORE_ADDR hppa_read_pc (struct regcache *regcache); extern void hppa_write_pc (struct regcache *regcache, CORE_ADDR pc); extern CORE_ADDR hppa_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame); extern struct minimal_symbol * hppa_lookup_stub_minimal_symbol (const char *name, enum unwind_stub_types stub_type); extern struct hppa_objfile_private * hppa_init_objfile_priv_data (struct objfile *objfile); extern int hppa_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name); extern CORE_ADDR hppa_skip_trampoline_code (struct frame_info *, CORE_ADDR pc); <<>>> So you can see that the ugly formatting, I proposed is already used twice. I found 37 occurrences listed below, should we considered those as badly formatted? Pierre $ grep -E "^ [a-z][a-zA-Z_0-9]* *\([^*][^()]*(\);|,)$" *.h ada-lang.h: ada_decode_exception_location (char *args, char **addr_string, ada-lang.h: ada_decode_assert_location (char *args, char **addr_string, alphabsd-tdep.h: alphanbsd_regset_from_core_section (struct gdbarch *gdbarch, arch-utils.h: simple_displaced_step_copy_insn (struct gdbarch *gdbarch, arch-utils.h: simple_displaced_step_free_closure (struct gdbarch *gdbarch, arch-utils.h: default_displaced_step_hw_singlestep (struct gdbarch *, arm-tdep.h: arm_process_displaced_insn (struct gdbarch *gdbarch, CORE_ADDR from, arm-tdep.h: arm_displaced_init_closure (struct gdbarch *gdbarch, CORE_ADDR from, arm-tdep.h: displaced_read_reg (struct regcache *regs, struct displaced_step_closure *dsc, arm-tdep.h: displaced_write_reg (struct regcache *regs, arm-tdep.h: arm_displaced_step_copy_insn (struct gdbarch *, CORE_ADDR, CORE_ADDR, arm-tdep.h: armbsd_regset_from_core_section (struct gdbarch *gdbarch, defs.h: make_cleanup_ui_out_redirect_pop (struct ui_out *uiout); defs.h: make_cleanup_restore_ui_file (struct ui_file **variable); defs.h: set_batch_flag_and_make_cleanup_restore_page_info (void); dwarf2-frame.h: dwarf2_frame_set_signal_frame_p (struct gdbarch *gdbarch, dwarf2-frame.h: dwarf2_frame_set_adjust_regnum (struct gdbarch *gdbarch, dwarf2-frame.h: dwarf2_frame_base_sniffer (struct frame_info *this_frame); event-loop.h: create_async_event_handler (async_event_handler_func *proc, event-loop.h: delete_async_event_handler (struct async_event_handler **handler_ptr); hppa-tdep.h: hppa_frame_prev_register_helper (struct frame_info *this_frame, hppa-tdep.h: hppa_lookup_stub_minimal_symbol (const char *name, i386-tdep.h: i386_regset_from_core_section (struct gdbarch *gdbarch, inferior.h: get_infcall_suspend_state_regcache (struct infcall_suspend_state *); inferior.h: get_displaced_step_closure_by_addr (CORE_ADDR addr); inferior.h: find_inferior_for_program_space (struct program_space *pspace); p-lang.h: is_pascal_string_type (struct type *, int *, int *, int *, p-lang.h: pascal_type_print_base (struct type *, struct ui_file *, int, int); p-lang.h: pascal_type_print_varspec_prefix (struct type *, struct ui_file *, int, int); sparc-tdep.h: sparc_frame_cache (struct frame_info *this_frame, void **this_cache); sparc-tdep.h: sparc32_frame_cache (struct frame_info *this_frame, void **this_cache); sparc-tdep.h: sparc32nbsd_sigcontext_saved_regs (struct frame_info *next_frame); sparc64-tdep.h: sparc64nbsd_sigcontext_saved_regs (CORE_ADDR sigcontext_addr, symfile.h: build_section_addr_info_from_objfile (const struct objfile *objfile); value.h: value_contents_for_printing_const (const struct value *value); value.h: create_internalvar_type_lazy (char *name, internalvar_make_value fun); varobj.h: varobj_set_visualizer (struct varobj *var, const char *visualizer);