lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

zerofighter <> wrote:

> for some reason, I'm compiling lua as a single cpp code (unity builds),
> that is, supply a `cpp` file that include all `*.c` files of lua source
> code
> would you please to support cpp unity builds compile method? Thanks

Out of curiosity, how are you creating a "unity cpp" file? Sadly, searching
for unity and cpp just gives me a ton of links about the Unity3D gaming
engine! Are you just 'cat'ing all the *.c files into a single *.cpp file and
leaving all the headers? Using Xcode I seem unable to generate the error you
have demonstrated, though I do see why the error could occur. I am curious
why it is considered an error for your build but not mine though?

At any rate, perhaps one fix might simply be to swap the entire contents of
the goto label at lines 1404-1409 with the goto statement at line 1475. This
would just move the 'condjump' logic to the OP_TEST vmcase block instead of
having it in the OP_EQ vmcase block.

Personally, I think moving the 'condjump' logic to the last vmcase block
that any goto targets reads nicer than having it be in the first block that
would use it. Also, it should remove the error regarding jumping into a
block after an uninitialised variable!

Let me know if that fixes your issue. I would test it for you but as I said
I am unable to generate the same error as you, and I am not entirely sure
what your build environment is.