This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: [RFA] Replace strdup with xstrdup in tic30-dis.c


[dropped gdb@]

A whinge.  This style of function declaration is a pain:

boolean function_with_a_long_name_or_lots_of_params PARAMS ((type1 arg1,
                                                             type2 arg2,
                                                             typen argn));

This is much better:

boolean function_with_a_long_name_or_lots_of_params
  PARAMS ((type1 arg1, type2 arg2, typen argn));

The first style means more editing when changing the return type or
function name as all the following lines need re-indenting.

Same goes for definitions.  This is a pain:

int some_func (a, b, c)
     boolean                a;
     all_lined_up_sweetly * b;
     int                    c;

Writing code this way almost guarantees that over time your code will
end up looking like:

int some_func (a, b, c)
     bfd_boolean                a;
     not_lined_up * b;
     int                    c;

Ditto local vars.
Easily fixed:

Run the file through indent (../gdb/gdb_indent.sh), glance at the results, have a few strong words to hewie[sp] and ralph, and then commit.

Of course, you would need to drop that K&R C requirement ....

Andrew



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