1. -1

  2. 2

    The first line compiles all V files in doom_v/ directory into a single doom.o object file. -translated tells V that the code was translated from C, so the compiler is less strict. For example it allows using i++ as an expression (in V it always must be a statement).

    Given the controversies about the accuracy of claims made about V (see the thread from a few days ago) this makes me a little bit suspicious. This could be interpreted as “the translator leaves in a bunch of C stuff we can’t do in V yet, and then the -translated flag tells the V compiler to just accept that C stuff.” I’m not saying that’s what’s happening, just that it’s a possibility.

    It would be interesting to know what other illegal syntax the -translated flag allows.

    1. 1

      This is not true, you can read the resulting V code yourself and git grep for pref.is_translated in the compiler.

      It’s for the mentioned i++ expression, casting ints to pointers, fixed arrays to pointers etc.

      The article you linked was mostly about a single checker bug that allowed mutability via mut x := y. It was fixed 2 days ago.