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

build: pass -fsigned-char on clang #1090

Merged
merged 1 commit into from
May 5, 2021
Merged

Conversation

tobhe
Copy link
Contributor

@tobhe tobhe commented May 4, 2021

Powerpc and ARM default to unsigned char which causes an immediate crash when starting the game.
On gcc this is prevented by passing -fsigned-char in CFLAGS and CXXFLAGS. This change does the same for clang.

Powerpc and ARM default to unsigned char which causes an immediate
crash when starting the game.
@xycaleth
Copy link
Member

xycaleth commented May 5, 2021

Out of curiosity, where is it crashing specifically when you try to start the game?

@tobhe
Copy link
Contributor Author

tobhe commented May 5, 2021

It's crashing right after dropping you into the actual game world when starting a new game. The character selection and cutscenes work.

The actual segfault happens in CFxScheduler::AddScheduledEffects():

if (cent.gent->ghoul2.IsValid())

The reason seems to be that the previous check in

else if (effect->mBoltNum == -1)

doesn't work because mBoltNum as a char is unsigned and the compiler decides that this can never be true.

Copy link
Member

@xycaleth xycaleth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Maybe in the future we can stop relying on char signedness but this is a good quick fix.

@xycaleth xycaleth merged commit 479a83a into JACoders:master May 5, 2021
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

Successfully merging this pull request may close these issues.

3 participants