From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29628 invoked by alias); 14 Mar 2011 17:02:22 -0000 Received: (qmail 29588 invoked by uid 22791); 14 Mar 2011 17:02:17 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT,TW_BJ,TW_EV,TW_VP,TW_YY X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.156) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Mar 2011 17:02:11 +0000 Received: from md1.u-strasbg.fr (md1.u-strasbg.fr [IPv6:2001:660:2402::186]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id p2EH1sCZ068644 ; Mon, 14 Mar 2011 18:01:54 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms4.u-strasbg.fr [130.79.204.13]) by md1.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p2EH1rD4010299 ; Mon, 14 Mar 2011 18:01:53 +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 p2EH1qtg070255 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) ; Mon, 14 Mar 2011 18:01:52 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Eli Zaretskii'" Cc: , References: <20110312015329.GA20179@sourceware.org> <010f01cbe157$aebb5cb0$0c321610$%muller@ics-cnrs.unistra.fr> <18667.385276831$1300008680@news.gmane.org> <001401cbe261$5490ec40$fdb2c4c0$%muller@ics-cnrs.unistra.fr> <83oc5dr6pj.fsf@gnu.org> In-Reply-To: <83oc5dr6pj.fsf@gnu.org> Subject: RE: [RFA-v2] Fix ARI warning about function call in first column Date: Mon, 14 Mar 2011 17:26:00 -0000 Message-ID: <002001cbe269$85ed0e60$91c72b20$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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/msg00736.txt.bz2 > -----Message d'origine----- > De=A0: Eli Zaretskii [mailto:eliz@gnu.org] > Envoy=E9=A0: lundi 14 mars 2011 17:46 > =C0=A0: Pierre Muller > Cc=A0: tromey@redhat.com; gdb-patches@sourceware.org > Objet=A0: Re: [RFA-v2] Fix ARI warning about function call in first > column >=20 > > From: "Pierre Muller" > > Cc: > > Date: Mon, 14 Mar 2011 17:03:16 +0100 > > > > Eli, this still leaves us with two > > cases for which we either have > > TYPE > > NAME (PARAMS); > > or > > TYPE NAME (PARAMS); > > with a single line that exceeds 80 columns. >=20 > I see no problem with long lines, if there are no better alternatives. > I generally dislike tools that raise warnings for perfectly valid and > readable code, and I don't think we must every follow minor stylistic > rule when that rule gives sub-optimal results. >=20 > But it sounds like I'm the only one (again). So I give up: do > whatever you and others think is right, and I will crawl back under my > rock. Don't do it, I finally committed something that should suit you as well... =20 > > I didn't really understand your comment about > > automatic indenting by emacs because I never used emacs :( >=20 > In Emacs, hitting the TAB key anywhere on a line of code reindents > this line according to the current setting of the coding style. The > default coding style is, not surprisingly, the GNU coding style > described in standards.texi. >=20 > So, when you hit TAB in a C source file on the second of the two lines > that say >=20 > TYPE > NAME (PARAMS); >=20 > Emacs reindents it like this: >=20 > TYPE > NAME (PARAMS); >=20 > You can also re-indent a whole region of source in Emacs, by marking > the region and pressing TAB. This is a very convenient way of > reformatting a large portion of code according to GNU standards (which > mostly happen to be GDB standards as well). When you re-indent a > large region like that, it is easy to undo the kind of formatting you > want to enforce, shown above, because you will not generally go back > and examine each line of the reformatted region -- you trust Emacs to > DTRT. >=20 > The net result will be, I fear, that such reformatting will > inadvertently undo the indentation of prototypes, and trigger ARI > warnings for no good reason. >=20 > I hope I made myself clear this time. Thanks for the explanation. Here is what I finally checked in, it does avoid indented lone function names. Personally, I would have done it like this: TYPE FUNC_NAME ( PARAMS); or TYPE FUNC_NAME ( PARAM1, PARAMS); but this is another problem. This should remove ARI warnings, and more importantly allow for easy finding of function implementation (which was my reason of adding that ARI rule). I hope everyone is OK with this. I think that we do have lots of other occurrences=20 of lines longer than 80 cols anyhow... Pierre 2011-03-14 Pierre Muller Fix ARI warning about function names in first column. Put prototype declaration on same line as return type. * objc-exp.y: Ditto. * p-exp.y: Ditto. * python/py-stopevent.h: Ditto. For long function names, split parameters to allow function name on same line as return type. * solib-pa64.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. For long function declaration, use single line. * hppa-tdep.h: Ditto. * inferior.h: Ditto.=09 Index: objc-exp.y =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/objc-exp.y,v retrieving revision 1.42 diff -u -p -r1.42 objc-exp.y --- objc-exp.y 14 Mar 2011 15:43:50 -0000 1.42 +++ objc-exp.y 14 Mar 2011 16:42:05 -0000 @@ -107,14 +107,11 @@ #define YYDEBUG 0 /* Default to no yydebug support. */ #endif =20 -int -yyparse (void); +int yyparse (void); =20 -static int -yylex (void); +static int yylex (void); =20 -void -yyerror (char *); +void yyerror (char *); =20 %} =20 @@ -150,8 +147,7 @@ yyerror (char *); =20 %{ /* YYSTYPE gets defined by %union. */ -static int -parse_number (char *, int, int, YYSTYPE *); +static int parse_number (char *, int, int, YYSTYPE *); %} =20 %type exp exp1 type_exp start variable qualified_name lcurly Index: p-exp.y =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/p-exp.y,v retrieving revision 1.55 diff -u -p -r1.55 p-exp.y --- p-exp.y 14 Mar 2011 15:43:50 -0000 1.55 +++ p-exp.y 14 Mar 2011 16:42:05 -0000 @@ -117,8 +117,7 @@ int yyparse (void); =20 static int yylex (void); =20 -void -yyerror (char *); +void yyerror (char *); =20 static char * uptok (char *, int); %} @@ -154,8 +153,7 @@ static char * uptok (char *, int); =20 %{ /* YYSTYPE gets defined by %union */ -static int -parse_number (char *, int, int, YYSTYPE *); +static int parse_number (char *, int, int, YYSTYPE *); =20 static struct type *current_type; static struct internalvar *intvar; Index: solib-pa64.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/solib-pa64.c,v retrieving revision 1.29 diff -u -p -r1.29 solib-pa64.c --- solib-pa64.c 11 Jan 2011 21:53:24 -0000 1.29 +++ solib-pa64.c 14 Mar 2011 16:42:05 -0000 @@ -76,8 +76,8 @@ dld_cache_t; =20 static dld_cache_t dld_cache; =20 -static int -read_dynamic_info (asection *dyninfo_sect, dld_cache_t *dld_cache_p); +static int read_dynamic_info (asection *dyninfo_sect, + dld_cache_t *dld_cache_p); =20 static void pa64_relocate_section_addresses (struct so_list *so, Index: varobj.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/varobj.c,v retrieving revision 1.172 diff -u -p -r1.172 varobj.c --- varobj.c 5 Mar 2011 22:02:47 -0000 1.172 +++ varobj.c 14 Mar 2011 16:42:06 -0000 @@ -296,8 +296,9 @@ static int is_root_p (struct varobj *var =20 #if HAVE_PYTHON =20 -static struct varobj * -varobj_add_child (struct varobj *var, const char *name, struct value *value); +static struct varobj * varobj_add_child (struct varobj *var, + const char *name, + struct value *value); =20 #endif /* HAVE_PYTHON */ =20 Index: varobj.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/varobj.h,v retrieving revision 1.27 diff -u -p -r1.27 varobj.h --- varobj.h 12 Jan 2011 01:23:29 -0000 1.27 +++ varobj.h 14 Mar 2011 16:42:06 -0000 @@ -167,8 +167,8 @@ extern int varobj_editable_p (struct var =20 extern int varobj_floating_p (struct varobj *var); =20 -extern void=20 -varobj_set_visualizer (struct varobj *var, const char *visualizer); +extern void varobj_set_visualizer (struct varobj *var, + const char *visualizer); =20 extern void varobj_enable_pretty_printing (void); =20 Index: python/py-stopevent.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/python/py-stopevent.h,v retrieving revision 1.1 diff -u -p -r1.1 py-stopevent.h --- python/py-stopevent.h 5 Feb 2011 05:27:23 -0000 1.1 +++ python/py-stopevent.h 14 Mar 2011 16:42:06 -0000 @@ -28,10 +28,8 @@ extern void stop_evpy_dealloc (PyObject=20 extern int emit_stop_event (struct bpstats *bs, enum target_signal stop_signal); =20 -extern PyObject * -create_breakpoint_event_object (PyObject *breakpoint); +extern PyObject *create_breakpoint_event_object (PyObject *breakpoint); =20 -extern PyObject * -create_signal_event_object (enum target_signal stop_signal); +extern PyObject *create_signal_event_object (enum target_signal stop_signal); =20 #endif /* GDB_PY_STOPEVENT_H */ Index: hppa-tdep.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/hppa-tdep.h,v retrieving revision 1.41 diff -u -p -r1.41 hppa-tdep.h --- hppa-tdep.h 9 Jan 2011 03:08:55 -0000 1.41 +++ hppa-tdep.h 14 Mar 2011 16:52:16 -0000 @@ -240,8 +240,7 @@ extern struct minimal_symbol * hppa_lookup_stub_minimal_symbol (const char *name, enum unwind_stub_types stub_type); =20 -extern struct hppa_objfile_private * -hppa_init_objfile_priv_data (struct objfile *objfile); +extern struct hppa_objfile_private * hppa_init_objfile_priv_data (struct objfile *objfile); =20 extern int hppa_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name); Index: inferior.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/inferior.h,v retrieving revision 1.152 diff -u -p -r1.152 inferior.h --- inferior.h 26 Feb 2011 02:07:08 -0000 1.152 +++ inferior.h 14 Mar 2011 16:52:16 -0000 @@ -366,8 +366,7 @@ extern int debug_displaced; void displaced_step_dump_bytes (struct ui_file *file, const gdb_byte *buf, size_t len); =20 -struct displaced_step_closure* -get_displaced_step_closure_by_addr (CORE_ADDR addr); +struct displaced_step_closure* get_displaced_step_closure_by_addr (CORE_ADDR addr); =20 /* Possible values for gdbarch_call_dummy_location. */ #define ON_STACK 1