This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: [PATCH] Re-indent (almost) top.c
- To: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Subject: Re: [PATCH] Re-indent (almost) top.c
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Mon, 03 Apr 2000 20:17:30 +1000
- CC: gdb-patches at sourceware dot cygnus dot com
- Organization: Cygnus Solutions
- References: <38E82BE2.D3FE4156@cygnus.com> <200004030909.FAA11856@indy.delorie.com>
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