This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] Re-indent (almost) top.c


Eli Zaretskii wrote:
> 
> > I've committed the attatched re-indent of top.c.
> [snip]
> > *************** cd_command (dir, from_tty)
> > *** 3645,3657 ****
> >   #endif
> >
> >     len = strlen (dir);
> > !   if (SLASH_P (dir[len-1]))
> >       {
> >         /* Remove the trailing slash unless this is a root directory
> > !      (including a drive letter on non-Unix systems).  */
> > !       if (!(len == 1) /* "/" */
> >   #if defined(_WIN32) || defined(__MSDOS__)
> > !       && !(!SLASH_P (*dir) && ROOTED_P (dir) && len <= 3) /* "d:/" */
> >   #endif
> >         )
> >       len--;
> > --- 3644,3656 ----
> >   #endif
> >
> >     len = strlen (dir);
> > !   if (SLASH_P (dir[len - 1]))
> >       {
> >         /* Remove the trailing slash unless this is a root directory
> > !          (including a drive letter on non-Unix systems).  */
> > !       if (!(len == 1)               /* "/" */
> >   #if defined(_WIN32) || defined(__MSDOS__)
> > !       && !(!SLASH_P (*dir) && ROOTED_P (dir) && len <= 3)   /* "d:/" */
> >   #endif
> >         )
> >       len--;
> 
> The above hunk (and a few more like it) worries me: it replaces TABs
> with spaces.  Is that a requirement of the GDB sources?  That would
> mean we are working against the default GNU indentation style, which
> I'd really hate to do.  I understand that the indent program is not
> the reason for these changes.  If so, then why do we need them?

It did several things, most importantly it fixed quite a few real
indentation problems vis:

	{
		foo ();
	 c=bar(a,b,c);
	}

An unfortunate side effect was that it also juggled a few tabs and
8-spaces.

As for a general tool, as you note, it fights with the EMACS C mode and
the GNU intdentation standard (vis structs) so it is best thought of as
a tool of last resort.

	enjoy,
		Andrew

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]