small bug in 'Convert to -> Formatted C code'

Started by Romashka, May 02, 2009, 01:37:16 PM

Previous topic - Next topic

Romashka

'Convert to -> Formatted C' code does not correctly formats some declarations:

void foobar(custom_t *foo, char *bar);
becomes
void foobar(custom_t * foo, char *bar);
here position of * is different for custom types comparing to standard C types.

EDIT: forgot to add that this bug exists in both 5.00.1 and 6.00 RC1.

Pelle

I suspect the problem here is that the formatter thinks it's looking at a multiplication. It's easy to recognize the standard types (char, double, ...) - it's much, much, harder to recognize "custom" type definitions (in code formatter, browse info manager, etc - none of them is a compiler, with a full context).

I will look at it, but I may not do much about it (a small bug compared to the very large job of fixing it, I think).
/Pelle

Romashka

I think it is safe to assume that there cannot be any multiplications in funtion definition.
Of course there can probbly be other cases where custom types can be confused with multiplication.
I agree that it's not worth to fix such small issue if it's not easy to do so.

Pelle

I strongly suspect the problem is to understand that a (small) set of tokens *is* a function definition - and not, say, an expression...
/Pelle