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

           Summary: frontend bug
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: atur...@yahoo.com


Im compiling the code bellow (present also in the attachment) for x86 with gcc
4.4.3 and 4.5. Is it correct that at the end of main the value of variable b
should have been 4? When executing I get value 3. 

#include "stdio.h"
int *ptr;

int inc(void){
    (*ptr)++;    
    return 1;
}

int main (void){
int a, b = 2;
ptr = &b;
b++ +  inc() ;

if(b==4)
    printf("correct\n");
else
    printf("incorrect %d\n",b);
return 1;
}

Reply via email to