gcc compiles this and lets it crash, clang gives an error