Repository navigation
Fixed issue #1289 - #41
Conversation
Fixed issue of bad tokenization of double pointers
hschlichter
left a comment
There was a problem hiding this comment.
This doesn't at all solve the "bad tokenization of double pointers" issue.
As far as we can see, the reason why the travis and appveyor tests are green is because it ignores the function prototypes that have the __declspec. Which is super specific and wrong.
Furthermore, this causes major regressions in our code base, because the default behavior is changing in a dramatic way.
In a meeting some weeks ago, we talked about how to solve this. Currently uncrustify doesn't know enough about the type information when parsing function prototypes. This could be solved by running through the parsing a second time. We take this approach in several places. If you have any doubts about to actually fix this issue, reach out to us on #devs-uncrustify so we can talk about the solution.
| { "__attribute__", CT_ATTRIBUTE, LANG_C | LANG_CPP }, | ||
| { "__block", CT_QUALIFIER, LANG_OC }, | ||
| { "__const__", CT_QUALIFIER, LANG_C | LANG_CPP }, | ||
| { "__declspec", CT_DECLSPEC, LANG_C | LANG_CPP | LANG_CS }, |
There was a problem hiding this comment.
__declspec is a C/C++ specific modifier. Why is C# added as a language?
| CT_MACRO, // a macro def | ||
| CT_QUALIFIER, // static, const, etc | ||
| CT_EXTERN, // extern | ||
| CT_DECLSPEC, // __declspec |
There was a problem hiding this comment.
It's way too specific to add as a token. If anything, it should be something about the storage class.
| if (first->type == CT_DECLSPEC) | ||
| { | ||
| log_rule("IGNORE"); | ||
| return(AV_IGNORE); |
There was a problem hiding this comment.
Why are you ignoring here? Doesn't make much sense.
|
There is still a diff on the unity-diff-checker. It removes a single line break. Which on the surface wouldn't seem like a big deal(and you can definitely argue that the line break should be removed). But the question is why does it do that? |
|
Hi Henrik, |
|
@unitydevtools test |
Fixed issue of bad tokenization of double pointers