[tlbuild] Compiling asy with recent gcc

Henri Menke henrimenke at gmail.com
Fri Mar 6 00:46:47 CET 2020


On 3/6/20 11:48 AM, Karl Berry wrote:
>     If I build without optimization, the problem doesn't occur.
> 
> Doesn't that imply a compiler bug?

Very unlikely.  It's more likely that your code invokes undefined
behaviour.  Consider this code:

#include <stdio.h>

int main() {
    int *i;
    {
        int j = 1;
        i = &j;
    }
    if (*i) {
        puts("true");
    } else {
        puts("false");
    }
}

This prints "true" with optimization, but "false" without.  You can try
it out online:

https://godbolt.org/z/YseMbV

Cheers, Henri


More information about the tlbuild mailing list.