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]

usage of tab in the indentation...


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?

(I am not trying to start a troll, ok? :-).
-- 
Joel


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