Hacker News new | ask | show | jobs
by david2ndaccount 55 days ago
Their specification is pretty bad, allowing code like:

    #include <stdio.h>
    #include <stddef.h>
    void v(int y[printf("hello world!\n")]){ 
    }

    int main(){
        v(NULL);
        typedef int wut[printf("oh no\n")];
    }
    $ cc vla.c && ./a.out
    hello world!
    oh no
`typedef`s with side effects...
1 comments

True, I would also prefer side effects would not be allowed. But simply don't do this. This is not a reason to avoid the feature in general.