-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typedef ordering issue. #213
Comments
You're right that mips_to_c is stricter about the ordering of struct definitions than most compilers are. In the example you gave, swapping sections 2 & 3 would fix the issues. Notably, it's always possible to reorder a (valid) C file to get something that mips_to_c will accept. Here's a smaller set of test cases that demonstrate the difference between mips_to_c and "standard C" (without using any typedefs): // Valid C, and also allowed by mips_to_c
struct foo { struct bar *x; };
struct bar { struct foo y; }; // Valid C, not allowed by mips_to_c
struct foo { struct bar x; };
struct bar { struct foo *y; }; // Neither valid C, nor allowed by mips_to_c
struct foo { struct bar x; };
struct bar { struct foo y; }; It would be possible to fix this in mips_to_c, at the cost of added complexity -- until now we haven't really seen many projects where this has been necessary though? |
Hmm, unfortunately there are at least 3 projects I'm working on (long term) which would benefit from this, which I'd like to be able to use automated tooling to create context which mips_to_c can understand, as I'm doing here. While it's not that difficult to manually individual occurances of this manually. It's possible I don't understand the scope of work that this feature would require for mips_to_c, but I suspect it is less work than for me to automatically export it this way, and would be a better outcome overall. |
Typedefs don't appear to work the way which they do in GCC (In games from the PS1/N64 era).
Yields this message in mips_to_c:
Yet, this code is valid, compiles, and functions properly with cc1psx (GCC).
I'm hoping this can be fixed so such syntax does work, it makes decomping games with partial source code significantly easier.
The text was updated successfully, but these errors were encountered: