decomp.me
decomp.me copied to clipboard
Errors in main file showing the lines in the context file [DS heartgold preset]
can comfirm this also happens in diamond, it's likely for all DS compiler versions
In the example, the 5th line of context.c is being shown instead of code.c, when the error is in code.c
We use a #line directive to tell the compiler when code.c begins: https://github.com/decompme/decomp.me/blob/576b0006f40a2a5d4fda9e8d5465c5faaf2c9f04/backend/coreapp/compiler_wrapper.py#L148-L154
This is likely a bug in your compiler - does it support #line?
Also note this part further down: https://github.com/decompme/decomp.me/blob/576b0006f40a2a5d4fda9e8d5465c5faaf2c9f04/backend/coreapp/compiler_wrapper.py#L158-L161C33 If is_mwcc isn't set for your compiler that could be the problem, but it could also be that that workaround isn't particularly stable...
this is for the compilers already on site, not for local testing, assuming that everything was set up correctly, then it's likely that the workaround doesn't work, as for #line, I wouldn't be surprised if it didn't work, because mwcc is very tempremental and old, and we often come across things that should work, but don't, ofc I haven't tested this, so it could potentially work just fine, and there's another issue
Can you run the following with the compiler locally?
#line 100 "it_works.c"
#error If this comes from it_works.c, it works!
e.g. clang test.c gives
it_works.c:100:2: error: If this comes from it_works.c, it works!
#error If this comes from it_works.c, it works!
^
1 error generated.
(and the same with touch it_works.c first, to check if the workaround works)
This was possibly fixed in #828, I'd assumed #505 meant it already wasn't an issue on the ds compilers but this does sound like the same thing I was getting for the wii ones
(The existing workaround was just for DWARF line numbers, not error messages)
@adrienntindall do you see this still happening? wondering if we can close this now
feel free to report here if it's still an issue
just checked, this does appear to be fixed indeed, thanks