emception icon indicating copy to clipboard operation
emception copied to clipboard

llvm-box: change the argv taken by llvm-box main entry

Open windowsair opened this issue 6 months ago • 0 comments

#27

It looks like llvm-box currently takes the first argument, argv[0], as the command. I'm not sure if this is intentional or if it's just a bug. In most environments, we would probably use it this way:

llvm-box clang main.cpp

In this case, argv[1] is clang, which is the command we really want. For most operating systems, as well as emscripten's callMain method, llvm-box is automatically added as argv[0]. So I'm not sure if the way it's currently written is intentional or not? It looks like we have to explicitly call the _main function and construct a sequence of arguments like this clang main.cpp

windowsair avatar Dec 30 '23 15:12 windowsair