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

This can sometime fail to evaluate properly #110

Open
rjonkman opened this issue Mar 23, 2023 · 0 comments
Open

This can sometime fail to evaluate properly #110

rjonkman opened this issue Mar 23, 2023 · 0 comments

Comments

@rjonkman
Copy link
Contributor

rjonkman commented Mar 23, 2023

if(StatusBlockWrapper.Tag != CBWTag) return msProcessError(MS_CSW_TAG_ERROR); // Tag mismatch error

The is probably a compiler optimization issue. Sometimes StatusBlockWrapper.Tag will evalute to 0 eventhough it's been updated in the background. Surpisingly declaring StatusBlockWrapper as volatile doesn't resolve the issue. I used the following hack just before the reference line of code to force the program to reread the value of StatusBlockWrapper.Tag.

char str[50];
sprintf(str, "%d", (int)StatusBlockWrapper.Tag);

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

1 participant