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

Static assert printf format #4393

Open
SiebrenW opened this issue Mar 20, 2025 · 0 comments
Open

Static assert printf format #4393

SiebrenW opened this issue Mar 20, 2025 · 0 comments

Comments

@SiebrenW
Copy link

The main advantages of this library in the format mode to me is the compile time check for the validity of the format.

Coming from a codebase with a printf style logger I extended it to use fmt for the above benefits, but had to keep a legacy log function around for the old code. The problem is that people aren't using the new one and are still making mistakes in the format of the printf-style log function.

Is it desired to add this static assert check to this library in the printf functions? For us, that would save us some iterations due to some formatting error crashing the program in testing (preferably it saying: "you messed up the printf format, and you should be using fmt anyways!").

For illustration purposes here's a godbolt link: https://godbolt.org/z/c6sa35635

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