canonical/mir

Move from `snprintf` and friends to `std::format*` and add checks for truncation

Open

#4,549 opened on Dec 15, 2025

View on GitHub
 (0 comments) (0 reactions) (0 assignees)C++ (137 forks)auto 404
Good first issue

Repository metrics

Stars
 (775 stars)
PR merge metrics
 (PR metrics pending)

Description

We should print if the output message was truncated to avoid red-herrings while debugging. In addition, it might be a good idea to move from the old printf style prints to std::format. Where allocation is not possible (error handling), std::format_to can also be used.

This covers printf, snprintf, vnprintf and other variants.

Contributor guide