[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Bug-indent] No space before `*' in declarations

From: David
Subject: RE: [Bug-indent] No space before `*' in declarations
Date: Sat, 7 Dec 2002 10:01:55 -0000

Thank you for your update. It will be handled when I reach it in the
backlog that has unfortunately built up. Some remarks:

1) Your previous patch has not been ignored - I just have not had time
to check it yet.
2) Your patch will just cause another flurry of complaints because
others do not want indent to change its output the way you do. To have
this style supported will need a switch to set it on for those who do
want it and leave things the way they are for the rest.
3) Have you read-up and tried the -T option to tell indent that
"foo_t"is a type that should be treated the same as char and the like?


-----Oorspronkelijk bericht-----
Van: address@hidden [mailto:address@hidden Namens
Pavel Roskin
Verzonden: 07 December 2002 02:18
Aan: address@hidden
Onderwerp: [Bug-indent] No space before `*' in declarations


My previous patch was ignored:

Let me try one more time.  This patch is different because it fixes the
space not only in function definitions, but also in function
Also it only applies to "*".  Other binary operators are still followed
space, although I don't think you can find them in declarations and

--- src/indent.c
+++ src/indent.c
@@ -1039,7 +1039,11 @@ static exit_values_ty indent (

-                parser_state_tos->want_blank = true;
+                /* no space after * in declarations and definitions */
+                parser_state_tos->want_blank = !(token[0] == '*'
+                                                 && parser_state_tos->
+                                                    procname[0] !=

             case postop:                /* got a trailing ++ or -- */

Test file:
int f (foo_t *a, char *b);
f (foo_t *a, char *b)
    char *c;
    foo_t *d;
    return 1 * 2;

I also tested patched indent on large C files, and the difference from
indent 2.2.8 is only what I expect it to be.

There is an alternative solution that can be considered by those who
the code better.  I believe that lexi() should return decl for "foo_t
just like it would do for "struct foo_t *a"

If you look for "The following hack" in lexi.c, it doesn't check if the
parser is working with function arguments.  I don't feel save about
changing that huge condition without having the testsuite.

Pavel Roskin

Bug-indent mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]