logoalt Hacker News

afdbcreid • today at 5:38 AM • 1 reply • view on HN

It is quite hard to come with a reliable example, but (https://c.godbolt.org/z/56bfYszEb):

    int* p = malloc(sizeof(int));
    int v = *p;
    if (!(v < 0 || v == 0 || v > 0)) {
        exit(1);
    }
This compiles into `exit(1)` in Clang under -O3.

Replies

kstrauser • today at 6:22 AM

How? That doesn’t seem like it should be possible. Why is that?

➕ show 2 replies