¿Bloque Clang en Linux?

 C Programming >> Programación C >  >> Tags >> Clang
¿Bloque Clang en Linux?

En Ubuntu Linux:

sudo apt-get install llvm
sudo apt-get install clang
sudo apt-get install libblocksruntime-dev

test.c :

#include <stdio.h>

int main() {
    void (^hello)(void) = ^(void) {
        printf("Hello, block!\n");
    };
    hello();
    return 0;
}

compilar:

clang test.c -fblocks -lBlocksRuntime -o test
./test

Hello, block!

funciona bien.