-
Notifications
You must be signed in to change notification settings - Fork 582
Known problems
-
Uncrustify currently does not keep track of braces that span multiple preprocessor blocks and therefore will abort and complain about missing braces in code like the example below:
#if(1) if(true) { #endif int i = 1; #if(1) } #endif
If you want to use Uncrustify on your code, avoid this kind of brace placement until this problem is fixed.
-
C++ is a notoriously hard to parse language as its grammar is ambiguous, context-dependent and potentially requires infinite lookahead to resolve some ambiguities.
Currently Uncrustify's parser is not well equipped to handle such edge cases well. This construct, for example, is problematic:
A b(c*d);
The above example could either be:
-
A declaration of a function
b
withA
as return type,c*
as a parameter type, andd
as the parameter nameor
-
A declaration of a variable
b
of typeA
, with a constructor call with the parameter of variablec
multiplied by variabled
To remove the ambiguity in the above example, parenthesis can be added around
c
so that the construct will be parsed as a variable declaration.A b((c)*d);
-