This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/61815] New: precedence of operators is not being followed
- From: "saisusheelsunkara at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 15 Jul 2014 18:21:16 +0000
- Subject: [Bug c/61815] New: precedence of operators is not being followed
- Auto-submitted: auto-generated
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