This is the mail archive of the gdb-patches@sources.redhat.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]
Other format: [Raw text]

Re: usage of tab in the indentation...


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.


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