rui314 / 8cc

A Small C Compiler
MIT License
6.12k stars 742 forks source link

The movement of inc/decrement must follow its type #85

Closed mame closed 7 years ago

mame commented 7 years ago
#include <stdio.h>

struct pair {
    int x;
    int y;
} a[] = { { 1, 2 }, { 3, 4 } }, *p = a;

int main() {
    p++;
    printf("%d\n", p->x);
}

3 is expected, but actually it prints 33554432.