https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61815

            Bug ID: 61815
           Summary: precedence of operators is not being followed
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: saisusheelsunkara at hotmail dot com

int i=3,y;
y=++i*++i*++i;
printf("%d",y);


here the output being printed is 150? but as per precedence of operators the
output must have been 216 but instead of considering precedence they are simply
excuting in the order they are to be done in the evaluation of postfix notation
where operands like ++i are treated literaly as a string.

where as on performing
y=++i*++i;
the output i am getting is 25 which is as per precedence of operators in c

Reply via email to