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

Ability to force use of fallback_file #3992

Closed
Wraiyth opened this issue Jun 6, 2024 · 2 comments
Closed

Ability to force use of fallback_file #3992

Wraiyth opened this issue Jun 6, 2024 · 2 comments

Comments

@Wraiyth
Copy link
Contributor

Wraiyth commented Jun 6, 2024

We have an issue where we are getting a crash in template <typename U> void append(const U* begin, const U* end) L919 memcpy(ptr_ + size_, begin, count * sizeof(T)); due to ptr_ being uninitialized. We have tracked this down to the underlying file buffer not being correctly initialized on this platform (a game console).

This particular platform does not have the flockfile, funlockfile, getc_unlocked and putc_unlocked posix methods. We've stubbed these out and forwarded them onto the platform methods, but still experiencing the same issue.

Ideally we would like to just force fmt to use fallback_file on this platform instead of apple_file (which is what is being detected and used).
Is there a way for us to do this in the library as it stands? We have added a FMT_FORCE_FALLBACK define around the templating of get_file to just force it in our own fork at this stage.

For context, this issue was not present in 9.x when we were using it, and seems related to the buffering changes introduced in 6b68dff this commit.

@vitaut
Copy link
Contributor

vitaut commented Jun 7, 2024

Is there a way for us to do this in the library as it stands?

No but a PR to control it via a macro would be welcome.

@Wraiyth
Copy link
Contributor Author

Wraiyth commented Jun 10, 2024

Is there a way for us to do this in the library as it stands?

No but a PR to control it via a macro would be welcome.

Absolutely! I just wanted to confirm I wasn't missing something else. I've opened PR #4009 with this define.

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