public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/61815] New: precedence of operators is not being followed
@ 2014-07-15 18:21 saisusheelsunkara at hotmail dot com
  2014-07-15 18:23 ` [Bug c/61815] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: saisusheelsunkara at hotmail dot com @ 2014-07-15 18:21 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/61815] precedence of operators is not being followed
  2014-07-15 18:21 [Bug c/61815] New: precedence of operators is not being followed saisusheelsunkara at hotmail dot com
@ 2014-07-15 18:23 ` pinskia at gcc dot gnu.org
  2014-07-15 18:45 ` saisusheelsunkara at hotmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-07-15 18:23 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The precedence of operators is being followed but what the C standard does not
say which side of the * is evaluated first.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/61815] precedence of operators is not being followed
  2014-07-15 18:21 [Bug c/61815] New: precedence of operators is not being followed saisusheelsunkara at hotmail dot com
  2014-07-15 18:23 ` [Bug c/61815] " pinskia at gcc dot gnu.org
@ 2014-07-15 18:45 ` saisusheelsunkara at hotmail dot com
  2014-07-15 18:46 ` saisusheelsunkara at hotmail dot com
  2014-07-15 18:50 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: saisusheelsunkara at hotmail dot com @ 2014-07-15 18:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from saisusheelsunkara at hotmail dot com ---
its from left to right order?
(In reply to Andrew Pinski from comment #1)
> The precedence of operators is being followed but what the C standard does
> not say which side of the * is evaluated first.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/61815] precedence of operators is not being followed
  2014-07-15 18:21 [Bug c/61815] New: precedence of operators is not being followed saisusheelsunkara at hotmail dot com
  2014-07-15 18:23 ` [Bug c/61815] " pinskia at gcc dot gnu.org
  2014-07-15 18:45 ` saisusheelsunkara at hotmail dot com
@ 2014-07-15 18:46 ` saisusheelsunkara at hotmail dot com
  2014-07-15 18:50 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: saisusheelsunkara at hotmail dot com @ 2014-07-15 18:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from saisusheelsunkara at hotmail dot com ---
if it is following the precedence then output must have been 216?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/61815] precedence of operators is not being followed
  2014-07-15 18:21 [Bug c/61815] New: precedence of operators is not being followed saisusheelsunkara at hotmail dot com
                   ` (2 preceding siblings ...)
  2014-07-15 18:46 ` saisusheelsunkara at hotmail dot com
@ 2014-07-15 18:50 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-07-15 18:50 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Just compile with -Wsequence-point or read the C standard on sequence points.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-15 18:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-15 18:21 [Bug c/61815] New: precedence of operators is not being followed saisusheelsunkara at hotmail dot com
2014-07-15 18:23 ` [Bug c/61815] " pinskia at gcc dot gnu.org
2014-07-15 18:45 ` saisusheelsunkara at hotmail dot com
2014-07-15 18:46 ` saisusheelsunkara at hotmail dot com
2014-07-15 18:50 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).