This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/13348] New: precedence of the operators ++ and parenthesis


The precendence of the parenthesis should be bigger then ++,
so in my belief the statement
all = (first = *pointer++) + (second=*pointer++);

should assign first the first entry in table,
and second the second value in the table.

But gcc assigns both the first value in the table
(executes: 
first=*pointer; second=*pointer; all=first+second; pointer++; pointer++;

instead of - in my belief correct:
first = *pointer++; second = *pointer++; all=first+second; 
)

I believe that this is a bug and not a feature which on matlab's windows'
compiler may work differently then in gcc.

Best regards,  igor dukanovic

-- 
           Summary: precedence of the operators ++ and parenthesis
           Product: gcc
           Version: 3.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: igor dot mat at uni-mb dot si
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13348


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]