On Mon, Aug 29, 2011 at 9:11 AM, Jie Zhang <[email protected]> wrote:
> On Mon, Aug 29, 2011 at 7:35 AM, Øyvind Harboe <[email protected]> 
> wrote:
>> I don't mind picking the kernel style, if nothing else because we then can 
>> get
>> scripts to check for the style.
>>
> It seems people like Linux kernel coding style. It's widely used and
> well documented. So I think it will be good.
>
> How about make a plan to do the coding style switch? We cannot do now
> immediately since it will break all patches in people's local trees.
> We need to set a roughly date so people can prepare for it. The end of
> this year or the beginning of the next year will be a good point time
> for me. I think I will have already pushed out all my patches at that
> time. And at that time, people will be in Christmas and New year
> holidays. There might be less development activities. So the impact
> will be likely less than other times of a year.
>
> What's your thought?
>
I am interested in this conversation, and I'm surprised it wasn't
squashed right away as inciting a holy war. So far, everybody's been
very civil, though I suspect that's because there hasn't been a great
deal of dissent.

I have no strong feelings as to which style should be used, but a
quick blanket application of indent's default styles of -gnu, -kr, and
-linux shows this:
indent-gnu: 340 files changed, 117612 insertions(+), 108216 deletions(-)
indent-kr: 341 files changed, 103813 insertions(+), 105417 deletions(-)
indent-linux: 341 files changed, 42192 insertions(+), 43373 deletions(-)

>From that cursory glance, we are most like the Linux style.

For the record, here are the relevant standards:
GNU: http://www.gnu.org/prep/standards/standards.html#Writing-C
Kernighan & Ritchie:
http://en.wikipedia.org/wiki/Indent_style#K.26R_style (sorry, didn't
try very hard on this one)
Linux: http://www.kernel.org/doc/Documentation/CodingStyle

Each run issued some warnings:
Warning:old style assignment ambiguity in "=&".  Assuming "= &"
Warning:old style assignment ambiguity in "=*".  Assuming "= *"
(Which I assume are because if you accidentally switch those
operators, it means something different)

And a cluster of errors/warnings about the comment style in
src/xsvf/xsvf.c, using #if 0 to "keep uncrustify from adding asterisks
at the beginning of every line."

I did not use the -T option to add OpenOCD's custom types to Indent's
syntax recognition, so custom-type casts aren't considered such and
where we declare pointers to custom types, Indent maybe thinks we're
multiplying, so the * isn't snuggled to the variable name.
+static int jim_version_command(Jim_Interp * interp, int argc,
+                              Jim_Obj * const *argv)

Also, Linus doesn't like typedefs (Chapter 5 of the Linux style), and
Indent handles "struct structname *x" correctly with being told about
custom names.

Best regards,
~Eric
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to