This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: usage of tab in the indentation...
- From: Michael Snyder <msnyder at redhat dot com>
- To: Joel Brobecker <brobecker at gnat dot com>, gdb-patches at sources dot redhat dot com
- Date: Thu, 12 Sep 2002 12:24:05 -0700
- Subject: Re: usage of tab in the indentation...
- Organization: Red Hat, Inc.
- References: <20020912190625.GB1105@gnat.com>
Joel Brobecker wrote:
>
> I don't really know where to ask this question, but since this is
> bugging me in the GDB sources, I'll ask here.
>
> I looked at the GNU Coding Standards manual, and they give a list of
> recommendations on how GNU code should be formatted, but they don't
> mention tabulations.
>
> In the list of options to GNU indent that they give, they leave the
> choice of tabs or not to indent (ie they use the default, which is to
> use tabs): (http://www.gnu.org/prep/standards_23.html#SEC23).
>
> I personally find that tabs are a nuisance, what are the advantages of
> using tabs? So far, they make my editor insert cursor go sometimes "like
> crazy" but more importantly, they sometimes screw the diff output.
> Consider the following hunk:
>
> <<
> --- 2071,2082 ----
> if (target_is_remote ())
> {
> if (args == 0 || *args == 0)
> ! {
> ! if (tracepoint_number == -1)
> ! error ("No current tracepoint -- please supply an argument.");
> ! else
> ! tdp = tracepoint_number; /* default is current TDP */
> ! }
> else
> tdp = parse_and_eval_long (args);
>
> >>
>
> See how the left curly brace is misplaced because of the tab?
>
> Could we consider banning tabs in favor of spaces and add -nut to
> the list of indent options in gdb_indent.sh?
For my part, I just use emacs' default formatting, which
pretty much relieves me of worrying about formatting, since
it almost always conforms to the coding standard. And emacs
uses tabs. It would be a nuisance for me to have to change.