Menu

#677 Fail on A?0:1 kind of if-s

Future
closed
nobody
None
5
2016-09-25
2016-08-12
mrx23dot
No

I get :
Error', 0, "Unexpected ')' for 'ANGLE_OPEN', which was on line 49")
Error', 0, "Unexpected '>' for 'PAREN_OPEN', which was on line 50")
Error', 0, "Unexpected '>' for 'PAREN_OPEN', which was on line 60")
for lines:

define MIN(a, b) (((a)<(b))?(a):(b))

define MAX(a, b) (((a)>(b))?(a):(b))

#define CONSTRAIN(amt, low, high) ((amt)<\
(low)?(low):((amt)>\
(high) ...

version
uncrustify 0.63.0-g44ce0f1

Discussion

  • Guy Maurel

    Guy Maurel - 2016-08-21

    Did you want:

    #define MIN(a, b) (((a)<(b))?(a):(b))
    #define MAX(a, b) (((a)>(b))?(a):(b))
    #define CONSTRAIN(amt, low, high) ((amt)<\
                                           (low)?(low):((amt)>\
                                                        (high) ...
    

    It works pretty fine for me.

     
  • mrx23dot

    mrx23dot - 2016-08-21

    Sorry the root cause was this:

    char test[] = {
    FR2TMR(30000u), FR2TMR(33000u), FR2TMR(36000u), FR2TMR(38000u), FR2TMR(38700u), FR2TMR(70000u), FR2TMR(56000u)};

    Still crashes on it, weird thing if I remove the 0-s it passes.

     
  • Guy Maurel

    Guy Maurel - 2016-08-24

    The actual git version works pretty fine.
    https://github.com/uncrustify/uncrustify
    Please test it!

     
  • mrx23dot

    mrx23dot - 2016-08-27

    Thanks! I will wait for the next binary release.

     
  • Mihai Popescu

    Mihai Popescu - 2016-09-05

    This issue should be closed either with fixed or with works-for-me

     
  • Guy Maurel

    Guy Maurel - 2016-09-25
    • status: open --> closed
     
  • Guy Maurel

    Guy Maurel - 2016-09-25