Skip to content
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

Compiler warning: unsequenced modification #126

Closed
hrydgard opened this issue Dec 18, 2017 · 1 comment
Closed

Compiler warning: unsequenced modification #126

hrydgard opened this issue Dec 18, 2017 · 1 comment

Comments

@hrydgard
Copy link
Contributor

Archs\MIPS\PsxRelocator.cpp:53:26:

                          skip += input[pos+skip++];

Having skip++ in an expression assigned to skip itself is not safe. Would be nice to get it cleaned up to avoid getting a warning when building.

@Kingcom
Copy link
Owner

Kingcom commented Dec 18, 2017

Yeah, I've run across that terrible line before... last time I looked at it I wasn't entirely sure what to actually replace it with (which kind of shows why it's a problem to have). But seeing different compiler outputs, almost all of them use the equivalent of skip += 1+input[pos+skip], so that seems to be the safest bet. Only exception I've seen was an old GCC version for ARM, which translated the whole statement to ++skip...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants