• [^] # Re: Des nouvelles du desktop

    Posté par . En réponse à la dépêche Des nouvelles du desktop. Évalué à 1.

    > et ca je pense que ca marche en pure C non ?
    ben non.

    [web123@gloup tmp]$ cat main.c
    #include <stdio.h>
    static int dummy_init(void) {
    printf("dummy here\n");
    }
    static int _test_dummy = dummy_init();
    int main(int argc, char** argv) {
    printf("main here\n");
    return 0;
    }
    [web123@gloup tmp]$ g++ main.c
    [web123@one tmp]$ ./a.out
    dummy here
    main here
    [web123@gloup tmp]$ gcc main.c
    main.c:5: initializer element is not constant
    [web123@gloup tmp]$